Reputation: 2997
In our environment we are using JUnit 4 TestListener
s to report test results to a remote server.
What is the JUnit 5 way doing that?
Upvotes: 7
Views: 9242
Reputation: 9089
You may use a TestExecutionListener
:
http://junit.org/junit5/docs/current/user-guide/#launcher-api-listeners-custom
7.1.4. Plugging in Your Own Test Execution Listeners
In addition to the public Launcher API method for registering test execution listeners programmatically, custom
TestExecutionListener
implementations discovered at runtime via Java’sjava.util.ServiceLoader
facility are automatically registered with theDefaultLauncher
.
"JUnit 5", read the JUnit Platform, ships some example listeners. You can view their source here:
Upvotes: 12