How to run a mix of JUnit 4 and JUnit 5 tests in p

2019-07-05 05:40发布

问题:

I am trying to run parallel integration tests in mix JUnit 4 and JUnit 5 using Junit Jupiter and Junit Vintage packages as well as adding a surefire plugin for junit 5 in dependencies for latest maven-failsafe-plugin.

    <dependencies>
      <dependency>
        <groupId>org.junit.platform</groupId>
        <artifactId>junit-platform-surefire-provider</artifactId>
        <version>1.0.1</version>
      </dependency>
    </dependencies> 

All the test run, but not in parallel and take a lot of time. If I don't add this dependency it won't pick and run the Junit 5 tests but run the other tests in parallel, it is configured in the plug in.

There is no official documentation for failsafe plugin using Junit 5. Is there a way to run the tests in parallel ?

Edit : logger write there is no use of threads (only main thread) when adding this dependency.