I have a gradle-based java testing framework.
After updating junit to 5.7.2 this warning started appearing for every test:
Jul 21, 2021 10:23:45 AM org.junit.platform.launcher.core.EngineDiscoveryOrchestrator lambda$logTestDescriptorExclusionReasons$7
INFO: 0 containers and 3 tests were Method or class mismatch
The junit dependencies in use are: junit-jupiter-api
, junit-jupiter-engine
, junit-jupiter-params
.
What may be causing it and what are the potential solutions?
platform. launcher. Public API for configuring and launching test plans. This API is typically used by IDEs and build tools.
JUnit Jupiter is the combination of the programming model and extension model for writing tests and extensions in JUnit 5. The Jupiter sub-project provides a TestEngine for running Jupiter based tests on the platform. JUnit Vintage provides a TestEngine for running JUnit 3 and JUnit 4 based tests on the platform.
JUnit Jupiter is the API for writing tests using JUnit version 5. JUnit 5 is the project name (and version) that includes the separation of concerns reflected in all three major modules: JUnit Jupiter, JUnit Platform, and JUnit Vintage.
JUnit 4 came in a single artifact, blending all uses cases into one bundle. The JUnit 5 architecture promotes a better separation of concerns and provides clear APIs for testers (Jupiter) and tools (Platform).
When you have multiple test methods in 1 class and execute only one of them, that warning appears. if you run all the test methods in that class, it doesn't appear. Judging from the warning message, you have made 4 @Test methods in a class and executed only one of it. The warning message is complaining that 3 other test methods were excluded from execution. If you execute all 4 test methods (Done by running the whole class), that message would disappear. In other words, it is a pointless warning and you can just ignore it.
If your are using Intellij, this might help you.
Preferences > Build, Execution, Deployment > Build Tools > Gradle Set "Build and run using:" and "Run tests using" to "Intellij IDEA"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With