import org.junit.Test;
import static org.junit.Assert.*;
public class TestOne {
@Test
public void one() {
assertTrue(true);
}
}
And this “ignored” one:
import org.junit.*;
import static org.junit.Assert.*;
@Ignore
public class TestTwo {
@Test
public void two() {
assertTrue(true);
}
}
When running “gradlew clean test --tests TestOne”, TestTwo shows up in the reports as ignored (which is technically correct). But why does TestTwo show up at all in the reports since my “–tests” filter certainly doesn’t match it?
The filter is applied while running the tests vs when the test runner finds the possible test classes. So it’s a feature. The test filter isn’t necessarily file based and could include a filter at a method level.