I have an interface like this:
public interface IntegrationTest { }
I configure the protected plugin as follows:
<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-failsafe-plugin</artifactId> <version>2.14</version> <configuration> <groups>acme.test.IntegrationTest</groups> </configuration> <executions> <execution> <goals> <goal>integration-test</goal> </goals> </execution> </executions> </plugin>
If I then create an integration test like this
@Category(IntegrationTest.class) public class ExampleClassIntegrationTest { @Test public void slow_and_painful_test() {
This test will not run.
If I, however, call the class according to the inclusion and exclusion of tests
**/IT*.java **/*IT.java **/*ITCase.java
Same:
@Category(IntegrationTest.class) public class ExampleClassIT { @Test public void slow_and_painful_test() {
The test runs fine. Why should I name a test? Do I have an annotation when I use the groups-tag? Am I missing something? The documentation for using JUnit states that you can use Category annotation at the class level.
source share