I have a unit tests that overrides a base test class. The test setups and tears down. However, due to particular reasons, I have commented out the only test in the file. I.e. the test class does not have a method with @Test annotation anymore.
When our continuous integration server runs all tests, it throws an error for this file:
java.lang.Exception: No runnable methods
This causes some annoyance, is it possible to change the rule not to throw an error here? I would like it to be more in the [info] violation category than error…
Just replace
@Testwith@Ignoreannotation.This has another benefit: automatic refactorings are still reflected in your test case class (but it’s not executed), so the code is not rotting and still compiles once you want to restore the test.
Moreover ignored tests are reported by various tools, so you can keep track of them.