diff options
author | Bjørn Christian Seime <bjorncs@oath.com> | 2017-10-25 14:54:17 +0200 |
---|---|---|
committer | Bjørn Christian Seime <bjorncs@oath.com> | 2017-10-25 14:54:17 +0200 |
commit | bbf54c75758d631c8626fd00e000d705c96a5d01 (patch) | |
tree | 56f9c6abfcdaafb1e3dd39ee2e115b940b18e4d5 /athenz-identity-provider-service | |
parent | 961515d330ebfa8981cf87361006bc9257ccbcde (diff) |
Make zone a constant
Diffstat (limited to 'athenz-identity-provider-service')
-rw-r--r-- | athenz-identity-provider-service/src/test/java/com/yahoo/vespa/hosted/athenz/instanceproviderservice/AthenzInstanceProviderServiceTest.java | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/athenz-identity-provider-service/src/test/java/com/yahoo/vespa/hosted/athenz/instanceproviderservice/AthenzInstanceProviderServiceTest.java b/athenz-identity-provider-service/src/test/java/com/yahoo/vespa/hosted/athenz/instanceproviderservice/AthenzInstanceProviderServiceTest.java index e4d18e34928..b93fae6af0f 100644 --- a/athenz-identity-provider-service/src/test/java/com/yahoo/vespa/hosted/athenz/instanceproviderservice/AthenzInstanceProviderServiceTest.java +++ b/athenz-identity-provider-service/src/test/java/com/yahoo/vespa/hosted/athenz/instanceproviderservice/AthenzInstanceProviderServiceTest.java @@ -99,6 +99,7 @@ public class AthenzInstanceProviderServiceTest { private static final Logger log = Logger.getLogger(AthenzInstanceProviderServiceTest.class.getName()); private static final int PORT = 12345; + private static final Zone ZONE = new Zone(SystemName.cd, Environment.dev, RegionName.from("us-north-1")); @Test public void provider_service_hosts_endpoint_secured_with_tls() throws Exception { @@ -114,11 +115,12 @@ public class AthenzInstanceProviderServiceTest { keyProvider, executor, mock(NodeRepository.class), - new Zone(SystemName.cd, Environment.dev, RegionName.from("us-north-1")), + ZONE, new SelfSignedCertificateClient(keyProvider.getKeyPair(), config)); try (CloseableHttpClient client = createHttpClient(domain, service)) { - Runnable certificateRefreshCommand = executor.getCommand().orElseThrow(() -> new AssertionError("Command not present")); + Runnable certificateRefreshCommand = executor.getCommand() + .orElseThrow(() -> new AssertionError("Command not present")); assertFalse(getStatus(client)); certificateRefreshCommand.run(); assertTrue(getStatus(client)); @@ -143,9 +145,8 @@ public class AthenzInstanceProviderServiceTest { Allocation allocation = new Allocation(appid, ClusterMembership.from("container/default/0/0", Version.fromString("1.2.3")), Generation.inital(), false); Flavor flavor = nodeFlavors.getFlavorOrThrow("default"); Node n = Node.create("ostkid", ImmutableSet.of("127.0.0.1"), new HashSet<>(), hostname, Optional.empty(), flavor, NodeType.tenant).with(allocation); when(nodeRepository.getNode(eq(hostname))).thenReturn(Optional.of(n)); - Zone zone = new Zone(Environment.dev, RegionName.from("us-north-1")); - IdentityDocumentGenerator identityDocumentGenerator = new IdentityDocumentGenerator(config, nodeRepository, zone, keyProvider); + IdentityDocumentGenerator identityDocumentGenerator = new IdentityDocumentGenerator(config, nodeRepository, ZONE, keyProvider); String rawSignedIdentityDocument = identityDocumentGenerator.generateSignedIdentityDocument(hostname); |