I have looked at a few other SO questions like this and this. But those questions are pretty dated and I'm curious if there exists a new solution.
Here's what my setup looks like:
Category interface:
public interface FastTest{}
Category suite:
@RunWith(Categories.class)
@IncludeCategory(FastTest.class)
public class FastSuite{}
Sample test:
@Category(FastTest.class)
public class FastTests{
@Test public void assertOneFastTest(){}
@Test public void assertTwoFastTest(){}
}
Using maven, let's say I want to only run all my FastTest
tests. Ideally, I would use the command
mvn test -Dtest.category=FastTest
or
mvn test -Dtest.suite=FastSuite
But I have not been able to get this working. Does anyone have any suggestions aside from using ClasspathSuite? Thanks.