Parameter Resolver: TestReporter

Learn how to use dependency injections (TestReporter parameter) in the constructor and test methods.

The org.junit.jupiter.engine.extension.TestReporterParameterResolver resolver resolves parameters of type org.junit.jupiter.api.TestReporter. The TestReporter parameter publishes additional data about the current test execution. The additional data is a map of key-value pairs. We can use the publishEntry(Map<String, String> values) method to publish a map of key-value pairs, or use the publishEntry(String key, String value) method to publish a single key-value pair. If the key is omitted, a value is used as the default key. Published data can be received using test execution listeners so they can be viewed in IDEs and reports.

Get hands-on with 1400+ tech skills courses.