void () { final Project project = myProjectFixture.getProject(); final PsiClass psiClass = findTestClass(project); final TestNGConfiguration configuration = createConfiguration(project); final TestNGConfigurationType type = TestNGConfigurationType.getInstance(); //class config configuration.beClassConfiguration(psiClass); PsiMethod testMethod = findTestMethod(psiClass); Assert.assertTrue(type.isConfigurationByLocation(configuration, new PsiLocation(project, psiClass))); Assert.assertFalse(type.isConfigurationByLocation(configuration, new PsiLocation(project, testMethod))); //method config configuration.beMethodConfiguration(new PsiLocation<>(project, testMethod)); Assert.assertTrue(type.isConfigurationByLocation(configuration, new PsiLocation(project, testMethod))); Assert.assertFalse(type.isConfigurationByLocation(configuration, new PsiLocation(project, psiClass))); }