diff options
author | Jon Marius Venstad <venstad@gmail.com> | 2021-11-17 13:37:57 +0100 |
---|---|---|
committer | Jon Marius Venstad <venstad@gmail.com> | 2021-11-17 13:37:57 +0100 |
commit | 2839357dea3b20ea4a77c8f41eaca021de8d5fbe (patch) | |
tree | dc61e2ba3eabfbf70a9ed8f8bca60fc09352d920 /vespa-osgi-testrunner | |
parent | db2f96fa2c56e5e93d45ec03d9a4b55100058f26 (diff) |
Verify response for empty report
Diffstat (limited to 'vespa-osgi-testrunner')
-rw-r--r-- | vespa-osgi-testrunner/src/test/java/com/yahoo/vespa/testrunner/TestRunnerHandlerTest.java | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/vespa-osgi-testrunner/src/test/java/com/yahoo/vespa/testrunner/TestRunnerHandlerTest.java b/vespa-osgi-testrunner/src/test/java/com/yahoo/vespa/testrunner/TestRunnerHandlerTest.java index 7183e1009f8..70a67edb0b1 100644 --- a/vespa-osgi-testrunner/src/test/java/com/yahoo/vespa/testrunner/TestRunnerHandlerTest.java +++ b/vespa-osgi-testrunner/src/test/java/com/yahoo/vespa/testrunner/TestRunnerHandlerTest.java @@ -77,7 +77,7 @@ public class TestRunnerHandlerTest { } @Test - public void returnsEmptyLogWhenReportNotReady() throws IOException { + public void returnsEmptyResponsesWhenReportNotReady() throws IOException { TestRunner testRunner = mock(TestRunner.class); when(testRunner.isSupported()).thenReturn(true); when(testRunner.getReport()).thenReturn(null); @@ -85,10 +85,19 @@ public class TestRunnerHandlerTest { Executors.newSingleThreadExecutor(), testRunner, null); - HttpResponse response = testRunnerHandler.handle(HttpRequest.createTestRequest("http://localhost:1234/tester/v1/log", GET)); - ByteArrayOutputStream out = new ByteArrayOutputStream(); - response.render(out); - assertEquals("{\"logRecords\":[]}", out.toString(UTF_8)); + { + HttpResponse response = testRunnerHandler.handle(HttpRequest.createTestRequest("http://localhost:1234/tester/v1/log", GET)); + ByteArrayOutputStream out = new ByteArrayOutputStream(); + response.render(out); + assertEquals("{\"logRecords\":[]}", out.toString(UTF_8)); + } + + { + HttpResponse response = testRunnerHandler.handle(HttpRequest.createTestRequest("http://localhost:1234/tester/v1/report", GET)); + ByteArrayOutputStream out = new ByteArrayOutputStream(); + response.render(out); + assertEquals("{}", out.toString(UTF_8)); + } } @Test |