Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Duplicate
-
3.0.0-M5
-
None
-
None
Description
I want to run Junit 4 and 5 test cases in same project. Some of the JUnit5 test cases also have @RunWith(JUnitPlatform.class) annotation to run with Junit4.
To successfully compile class having above annotation, I would need to add "junit-platform-runner" dependency in pom.xml, but the moment I add it, Maven ignores JUnit 5 test cases.
I have tried various combinations but nothing seems to work. Note that if I remove the class having above annotation and remove "junit-platform-runner" dependency from pom, then Maven is able to run the remaining Junit 4 and 5 test cases successfully. Problem seems to be only with @RunWith(JUnitPlatform.class) annotation and "junit-platform-runner" dependency.
Note that when I use maven-surefire-plugin version 3.0.0-M4, then everything works fine. Seems to be a bug with 3.0.0-M5.
Source code - https://github.com/niajthat/junit45
Attachments
Issue Links
- is related to
-
SUREFIRE-2033 Regression: 3.0.0-M5 misidentifies JUnit 5 configuration as JUnit 4
- Open