Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What causes a junit warning org.junit.platform.launcher.core.EngineDiscoveryOrchestrator lambda$logTestDescriptorExclusionReasons$7

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?

like image 280
bohdan Avatar asked Jul 21 '21 07:07

bohdan


People also ask

What is JUnit platform launcher?

platform. launcher. Public API for configuring and launching test plans. This API is typically used by IDEs and build tools.

What does JUnit Jupiter engine does?

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.

What is JUnit and JUnit Jupiter?

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.

Is JUnit 5 the same as JUnit Jupiter?

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).


2 Answers

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.

like image 90
jeff pentagon Avatar answered Nov 15 '22 11:11

jeff pentagon


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"

like image 40
kohei.okamoto Avatar answered Nov 15 '22 13:11

kohei.okamoto