diff options
author | Bjørn Christian Seime <bjorncs@oath.com> | 2018-08-14 17:38:48 +0200 |
---|---|---|
committer | Bjørn Christian Seime <bjorncs@oath.com> | 2018-08-14 17:38:48 +0200 |
commit | 13d7b9aed7b5141896c27e56653432ce67777e69 (patch) | |
tree | 5967c77c06818b67cacdda0cdf92e2f6c6da3524 /service-monitor/src/test | |
parent | 09869d3ba2590ee29b3349eb68da9e75fd6bd525 (diff) |
Simplify HealthClient by using ServiceIdentitySslSocketFactory
Diffstat (limited to 'service-monitor/src/test')
-rw-r--r-- | service-monitor/src/test/java/com/yahoo/vespa/service/monitor/internal/health/HealthClientTest.java | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/service-monitor/src/test/java/com/yahoo/vespa/service/monitor/internal/health/HealthClientTest.java b/service-monitor/src/test/java/com/yahoo/vespa/service/monitor/internal/health/HealthClientTest.java index c3e06faaf92..43200a8fa2e 100644 --- a/service-monitor/src/test/java/com/yahoo/vespa/service/monitor/internal/health/HealthClientTest.java +++ b/service-monitor/src/test/java/com/yahoo/vespa/service/monitor/internal/health/HealthClientTest.java @@ -110,8 +110,7 @@ public class HealthClientTest { HttpEntity httpEntity = mock(HttpEntity.class); when(response.getEntity()).thenReturn(httpEntity); - try (HealthClient healthClient = new HealthClient(endpoint, () -> client, entry -> content)) { - healthClient.start(); + try (HealthClient healthClient = new HealthClient(endpoint, client, entry -> content)) { when(httpEntity.getContentLength()).thenReturn((long) content.length()); return healthClient.getHealthInfo(); @@ -125,8 +124,7 @@ public class HealthClientTest { when(client.execute(any())).thenThrow(new ConnectTimeoutException("exception string")); - try (HealthClient healthClient = new HealthClient(endpoint, () -> client, entry -> "")) { - healthClient.start(); + try (HealthClient healthClient = new HealthClient(endpoint, client, entry -> "")) { HealthInfo info = healthClient.getHealthInfo(); assertFalse(info.isHealthy()); assertEquals(ServiceStatus.DOWN, info.toServiceStatus()); @@ -152,8 +150,7 @@ public class HealthClientTest { when(response.getEntity()).thenReturn(httpEntity); String content = "{}"; - try (HealthClient healthClient = new HealthClient(endpoint, () -> client, entry -> content)) { - healthClient.start(); + try (HealthClient healthClient = new HealthClient(endpoint, client, entry -> content)) { when(httpEntity.getContentLength()).thenReturn((long) content.length()); HealthInfo info = healthClient.getHealthInfo(); |