O'Reilly logo

Mastering Software Testing with JUnit 5 by Boni García

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

TestReporterParameterResolver

The last built-in resolver in JUnit 5 is TestReporterParameterResolver. Again, given a test class, if a method parameter is of type TestReporter, the TestReporterParameterResolver  supplies an instance of TestReporter.

TestReporter is used to publish additional data about the test execution. The data can be consumed through the method reportingEntryPublished, and then, it can be requested by IDEs or included in test reports. Each TestReporter object stores information as a map, that is, a key-value collection:

TestReporter API

This test provides a simple example of TestReporter. As we can see, we use the injected ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required