Can't you use the @RunWith annotation provided by jUnit?
import com.example.YourTestRunner;
@RunWith(YourTestRunner.class)
public class SomeIntegrationTest {
@Test
public void simpleTest() {
// given, when, then
}
}
Update
Based on the comment:
My class isn't a test runner, but a class that uses @RunWith
you can use inheritance to solve the problem:
@RunWith(SomeTestRunner.class)
@Ignore("Not a real test class because it does not contain any @Test methods, but needed to keep surefire happy")
public class ParentTest {
// this is the reusable class that is in the jar file
}
public class SomeIntegrationTest extends ParentTest {
@Test
public void simpleTest() {
// given, when, then
}
}