diff options
Diffstat (limited to 'vespa-http-client')
-rw-r--r-- | vespa-http-client/src/test/java/com/yahoo/vespa/http/client/core/operationProcessor/OperationProcessorTest.java | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/vespa-http-client/src/test/java/com/yahoo/vespa/http/client/core/operationProcessor/OperationProcessorTest.java b/vespa-http-client/src/test/java/com/yahoo/vespa/http/client/core/operationProcessor/OperationProcessorTest.java index 54293495d5c..0c636ba804e 100644 --- a/vespa-http-client/src/test/java/com/yahoo/vespa/http/client/core/operationProcessor/OperationProcessorTest.java +++ b/vespa-http-client/src/test/java/com/yahoo/vespa/http/client/core/operationProcessor/OperationProcessorTest.java @@ -23,6 +23,7 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertThat; import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.anyLong; import static org.mockito.Mockito.mock; @@ -414,15 +415,27 @@ public class OperationProcessorTest { } @Test - public void testUnknownHost() { + public void unknownHostThrowsExceptionAtConstructionTime() { try { - new SessionParams.Builder() + SessionParams sessionParams = new SessionParams.Builder() .addCluster(new Cluster.Builder().addEndpoint(Endpoint.create("localhost")).build()) - .addCluster(new Cluster.Builder().addEndpoint(Endpoint.create("unknown")).build()) + .addCluster(new Cluster.Builder().addEndpoint(Endpoint.create("unknown.invalid")).build()) .build(); + ScheduledThreadPoolExecutor executor = mock(ScheduledThreadPoolExecutor.class); + + CountDownLatch countDownLatch = new CountDownLatch(3); + + OperationProcessor operationProcessor = new OperationProcessor( + new IncompleteResultsThrottler(19, 19, null, null), + (docId, documentResult) -> { + countDownLatch.countDown(); + }, + sessionParams, executor); + + fail("Expected exception"); } catch (IllegalArgumentException e) { - assertEquals("", e.getMessage()); + assertEquals("Unknown host: unknown.invalid:4080 ssl=false", e.getMessage()); } } |