void () { myFixture.addClass("package org.mockito.junit; import org.junit.runner.Runner; import org.junit.runner.manipulation.Filterable; " + "public class MockitoJUnitRunner extends Runner implements Filterable {}"); PsiFile file = myFixture.configureByText("MockitoRunnerTest.java", """ import org.junit.rules.ExternalResource; import org.mockito.junit.MockitoJUnitRunner; import org.junit.runner.RunWith; @RunWith(MockitoJUnitRunner.class) public class MockitoRunnerTest { @org.junit.Rule public ExternalResource noTest() {return null;} public void foo() {}} """); PsiClass aClass = ((PsiClassOwner)file).getClasses()[0]; TestFramework framework = TestFrameworks.detectFramework(aClass); assertNotNull(framework); assertTrue(framework.isTestClass(aClass)); assertFalse(framework.isTestMethod(aClass.getMethods()[0])); assertFalse(framework.isTestMethod(aClass.getMethods()[1])); }