aboutsummaryrefslogtreecommitdiffstats
path: root/jrt/tests/com/yahoo/jrt/EchoTest.java
diff options
context:
space:
mode:
authorBjørn Christian Seime <bjorncs@verizonmedia.com>2022-07-19 14:30:27 +0200
committerGitHub <noreply@github.com>2022-07-19 14:30:27 +0200
commit46ba1b00aa19e937e2c257b34c23417adeef56eb (patch)
tree7e595f7ca0c17bc74b07c18472f4cd2d4f57c4d4 /jrt/tests/com/yahoo/jrt/EchoTest.java
parent8be6dd28753425126507b68c93a24607124871eb (diff)
parent529a26d7e1062a006196366454f1a047ca31202c (diff)
Merge pull request #23496 from vespa-engine/bjorncs/capabilitiesv8.21.11
Bjorncs/capabilities
Diffstat (limited to 'jrt/tests/com/yahoo/jrt/EchoTest.java')
-rw-r--r--jrt/tests/com/yahoo/jrt/EchoTest.java23
1 files changed, 12 insertions, 11 deletions
diff --git a/jrt/tests/com/yahoo/jrt/EchoTest.java b/jrt/tests/com/yahoo/jrt/EchoTest.java
index 26d4315fad6..e6243eaf4da 100644
--- a/jrt/tests/com/yahoo/jrt/EchoTest.java
+++ b/jrt/tests/com/yahoo/jrt/EchoTest.java
@@ -2,6 +2,7 @@
package com.yahoo.jrt;
+import com.yahoo.security.tls.authz.ConnectionAuthContext;
import org.junit.After;
import org.junit.Before;
import org.junit.runner.RunWith;
@@ -28,19 +29,19 @@ public class EchoTest {
Supervisor client;
Target target;
Values refValues;
- SecurityContext securityContext;
+ ConnectionAuthContext connAuthCtx;
private interface MetricsAssertions {
void assertMetrics(TransportMetrics.Snapshot snapshot) throws AssertionError;
}
- private interface SecurityContextAssertion {
- void assertSecurityContext(SecurityContext securityContext) throws AssertionError;
+ private interface ConnectionAuthContextAssertion {
+ void assertConnectionAuthContext(ConnectionAuthContext authContext) throws AssertionError;
}
@Parameter(value = 0) public CryptoEngine crypto;
@Parameter(value = 1) public MetricsAssertions metricsAssertions;
- @Parameter(value = 2) public SecurityContextAssertion securityContextAssertion;
+ @Parameter(value = 2) public ConnectionAuthContextAssertion connAuthCtxAssertion;
@Parameters(name = "{0}") public static Object[] engines() {
@@ -62,7 +63,7 @@ public class EchoTest {
assertEquals(1, metrics.serverTlsConnectionsEstablished());
assertEquals(1, metrics.clientTlsConnectionsEstablished());
},
- (SecurityContextAssertion) context -> {
+ (ConnectionAuthContextAssertion) context -> {
List<X509Certificate> chain = context.peerCertificateChain();
assertEquals(1, chain.size());
assertEquals(CryptoUtils.certificate, chain.get(0));
@@ -80,7 +81,7 @@ public class EchoTest {
assertEquals(1, metrics.serverTlsConnectionsEstablished());
assertEquals(1, metrics.clientTlsConnectionsEstablished());
},
- (SecurityContextAssertion) context -> {
+ (ConnectionAuthContextAssertion) context -> {
List<X509Certificate> chain = context.peerCertificateChain();
assertEquals(1, chain.size());
assertEquals(CryptoUtils.certificate, chain.get(0));
@@ -146,7 +147,7 @@ public class EchoTest {
for (int i = 0; i < p.size(); i++) {
r.add(p.get(i));
}
- securityContext = req.target().getSecurityContext().orElse(null);
+ connAuthCtx = req.target().getConnectionAuthContext().orElse(null);
}
@org.junit.Test
@@ -164,11 +165,11 @@ public class EchoTest {
if (metricsAssertions != null) {
metricsAssertions.assertMetrics(metrics.snapshot().changesSince(startSnapshot));
}
- if (securityContextAssertion != null) {
- assertNotNull(securityContext);
- securityContextAssertion.assertSecurityContext(securityContext);
+ if (connAuthCtxAssertion != null) {
+ assertNotNull(connAuthCtx);
+ connAuthCtxAssertion.assertConnectionAuthContext(connAuthCtx);
} else {
- assertNull(securityContext);
+ assertNull(connAuthCtx);
}
}
}