I have a parameterized JUnit 5 test, e.g.
@EnumSource(Mode.class)
@ParameterizedTest void shouldRunWithMode(Mode mode) {
...
I want to exclude one of the enum cases from running in Maven, as described here:
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.2</version>
<configuration>
<test>!testpackage.SomeTest#shouldRunWithMode[3 three]</test>
</configuration>
</plugin>
The same thing without the !
would mean inclusion, i.e. execute only this test.
I played around with the exclude expression and the square brackets, but I didn't find a combination to make it work.
A demo project is on GitHub.