- Exclude that particular class from tests under surefire plugins configuration in my pom.xml
- Remove @Test annotation from test method in the test class. Which fails as it finds a Test class but does not find any test methods
- Rename the class from say MyTest to something that does not end with "Test" say "Tezt"
After looking at the JUnit javadocs, I stumbled upon an annotation @Ignore it is indeed an annotation to be used if you want to skip the test.
So if you want to disable your test case in JUnit 4.4 just annotate your test methond with @Ignore @Test annotations.
What it also did was that Maven started reposting one test as being "Skipped" which is nicer as it keeps reminding you that you need to look after the test that you have disabled.
0 comments :
Post a Comment