summaryrefslogtreecommitdiffstats
path: root/vespa-http-client
diff options
context:
space:
mode:
authorJon Bratseth <bratseth@verizonmedia.com>2020-01-07 14:23:19 +0100
committerJon Bratseth <bratseth@verizonmedia.com>2020-01-07 14:23:19 +0100
commitb92b5c31216fb331d9bc6b63c13c99424e7991d9 (patch)
tree5a522db373fb151513fa19e7319c99328cd834e8 /vespa-http-client
parentb0d801daed411fa114223a5e6f0663b595334de5 (diff)
Test properly
Diffstat (limited to 'vespa-http-client')
-rw-r--r--vespa-http-client/src/test/java/com/yahoo/vespa/http/client/core/operationProcessor/OperationProcessorTest.java21
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());
}
}