From 2f109cdc95f0b5310750764ac1b5f4e0cb8ebfb5 Mon Sep 17 00:00:00 2001 From: Jon Marius Venstad Date: Thu, 3 Mar 2022 13:51:06 +0100 Subject: Improve JUnit test runner output --- .../test/java/com/yahoo/vespa/testrunner/TestRunnerHandlerTest.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'vespa-osgi-testrunner/src/test/java/com/yahoo/vespa/testrunner/TestRunnerHandlerTest.java') 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 cd120967bf4..49dd2b20797 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 @@ -32,7 +32,7 @@ import static org.mockito.Mockito.when; */ class TestRunnerHandlerTest { - private static final Instant testInstant = Instant.ofEpochMilli(1598432151660L); + private static final Instant testInstant = Instant.ofEpochMilli(12_000L); private TestRunnerHandler testRunnerHandler; private TestRunner aggregateRunner; @@ -60,7 +60,7 @@ class TestRunnerHandlerTest { HttpResponse response = testRunnerHandler.handle(HttpRequest.createTestRequest("http://localhost:1234/tester/v1/report", GET)); ByteArrayOutputStream out = new ByteArrayOutputStream(); response.render(out); - JsonTestHelper.assertJsonEquals(out.toString(UTF_8), "{\"summary\":{\"success\":1,\"failed\":2,\"ignored\":3,\"aborted\":4,\"inconclusive\":5,\"failures\":[{\"testName\":\"Foo.bar()\",\"testError\":\"org.junit.ComparisonFailure: expected: but was:\",\"exception\":\"java.lang.RuntimeException: org.junit.ComparisonFailure: expected: but was:\\n\\tat Foo.bar(Foo.java:1123)\\n\"}]},\"output\":[\"Tests started\"]}"); + JsonTestHelper.assertJsonEquals(out.toString(UTF_8), "{\"summary\":{\"success\":1,\"failed\":2,\"ignored\":3,\"aborted\":4,\"inconclusive\":5,\"failures\":[{\"testName\":\"Foo.bar()\",\"testError\":\"org.junit.ComparisonFailure: expected: but was:\",\"exception\":\"java.lang.RuntimeException: org.junit.ComparisonFailure: expected: but was:\\n\\tat Foo.bar(Foo.java:1123)\\n\"}]},\"output\":[\"00:00:12.000 Tests started\"]}"); } @Test @@ -71,7 +71,7 @@ class TestRunnerHandlerTest { HttpResponse response = testRunnerHandler.handle(HttpRequest.createTestRequest("http://localhost:1234/tester/v1/log", GET)); ByteArrayOutputStream out = new ByteArrayOutputStream(); response.render(out); - JsonTestHelper.assertJsonEquals(out.toString(UTF_8), "{\"logRecords\":[{\"id\":0,\"at\":1598432151660,\"type\":\"info\",\"message\":\"Tests started\"}]}"); + JsonTestHelper.assertJsonEquals(out.toString(UTF_8), "{\"logRecords\":[{\"id\":0,\"at\":12000,\"type\":\"info\",\"message\":\"Tests started\"}]}"); // Should not get old log response = testRunnerHandler.handle(HttpRequest.createTestRequest("http://localhost:1234/tester/v1/log?after=0", GET)); -- cgit v1.2.3