For those who mix JUnit 4 and JUnit 5 tests (for example, you have JUnit 4 tests, and now you want to add parametric testing with JUnit 5), then this is for you. If you have an import like this:
import org.junit.Test; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.MethodSource;
You mixed the import. You can get an exception
java.lang.Exception: no tests were found matching the foo method ...
Update all imports to JUnit 5:
import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.MethodSource;
JUnit Vintage exceptions should end.
source share