Ignore test cases in Junit
Introduction#
Sometimes you want to ignore some of the test cases you have in Junit. For instance, they are partially done and you want to come back to them later.
Ignore test case in Junit
- Go to the test method you want to ignore
- Before the
@Test
annotation, enter@Ignore
- optional: You can add description why are you ignoring this test method, something like:
@Ignore ("ignoring this test case for now")
a sample method would be:
@Ignore ("not going to test this method now")
@Test
public void test() {
assertfalse(true);
}