I'm experimenting the JUnit5 TestReporter, and even though it's so basic, I can't seem to find the output. Here is my simple test:
@Test
void testReporterExamples(TestReporter testReporter) {
System.out.println("Before test reporter");
testReporter.publishEntry("My message");
testReporter.publishEntry("key", "value");
Map<String, String> map = new HashMap<>();
map.put("k1", "v1");
map.put("k2", "v2");
testReporter.publishEntry(map);
System.out.println("After test reporter");
}
And here is my Gradle command and output:
% ./gradlew clean test --tests org.example.ParameterResolverTest.testReporterExamples
> Task :test
ParameterResolverTest > testReporterExamples(TestReporter) STANDARD_OUT
Running test: testReporterExamples(TestReporter)
Before test reporter
After test reporter
ParameterResolverTest > testReporterExamples(TestReporter) PASSED
Test result: SUCCESS
Test summary: 1 tests, 1 succeeded, 0 failed, 0 skipped
BUILD SUCCESSFUL in 12s
5 actionable tasks: 4 executed, 1 up-to-date
As you can see, nothing is printed to stdout. I also looked at the local report file in the project: java-testing-concepts/build/reports/tests/test/classes/org.example.ParameterResolverTest.html, and the values are not published there either.
Are the values written to a log file? Thanks