. Advertisement .
..3..
. Advertisement .
..4..
I get an error
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.22.2:test (default-test) on project XXX: There are test failures.
[ERROR]
[ERROR] Please refer to D:\Projets\workspace\XXX\target\surefire-reports for the individual test results.
[ERROR] Please refer to dump files (if any exist) [date].dump, [date]-jvmRun[N].dump and [date].dumpstream.
[ERROR] There was an error in the forked process
[ERROR] TestEngine with ID 'junit-vintage' failed to discover tests
[ERROR] org.apache.maven.surefire.booter.SurefireBooterForkException: There was an error in the forked process
[ERROR] TestEngine with ID 'junit-vintage' failed to discover tests
[ERROR] at org.apache.maven.plugin.surefire.booterclient.ForkStarter.fork(ForkStarter.java:656)
when trying to use Spring Boot 2.2 for my unit tests. How to fix the testengine with id ‘junit-vintage’ failed to discover tests error? Please give me some advice.
The cause:
The reason of the error ”testengine with id ‘junit-vintage’ failed to discover tests” is that
JUnit 4
is excluded or not included in the project when it relies onspring-boot-starter-test
. By default, thespring-boot-starter-test
has a dependency on thejunit-vintage-engine
, so testengine with id ‘junit-vintage’ can not explore tests.Solution:
The problem is solved by explicitly including the following dependencies while upgrading
junit-vintage-engine
:Another way is excluding the vintage which has worked as the following:
The above suggestions aree the best solution for solving ”testengine with id ‘junit-vintage’ failed to discover tests” error. I hope they are helpful for you. Good lucks!
The error was discovered by me. Dependency on
spring-boot-starter-test
creates a dependency uponjunit-vintage-engine
. This dependency must be removed: