Our toolkit has over 15000 JUnit tests, and many tests are known to fail if some other test fails. For example, if the method X.foo() uses functionality from Y.bar() and YTest.testBar() fails, then XTest.testFoo() will fail too. Obviously, XTest.testFoo() can also fail because of problems specific to X.foo().
While this is fine and I still want both tests run, it would be nice if one could annotate a test dependency with XTest.testFoo() pointing to YTest.testBar(). This way, one could immediately see what functionality used by X.foo() is also failing, and what not.
Is there such annotation available in JUnit or elsewhere? Something like:
public XTest {
@Test
@DependsOn(method=org.example.tests.YTest#testBar)
public void testFoo() {
// Assert.something();
}
}