return runnerProvider.newInstance("org.mockito.internal.runners.JUnit45AndHigherRunnerImpl", klass);
} else {
return runnerProvider.newInstance("org.mockito.internal.runners.JUnit44RunnerImpl", klass);
}
} catch (InvocationTargetException e) {
if (!new TestMethodsFinder().hasTestMethods(klass)) {
throw new MockitoException(
"\n" +
"\n" +
"No tests found in " + klass.getSimpleName() + "\n" +
"Haven't you forgot @Test annotation?\n"