boolean ( @NotNull TestNGConfiguration configuration, ConfigurationContext context, @NotNull Ref<PsiElement> sourceElement ) { // TODO: check TestNG Pattern running first, before method/class (see TestNGInClassConfigurationProducer for logic) // TODO: and PsiClassOwner not handled, which is in TestNGInClassConfigurationProducer Location location = context.getLocation(); if (location == null) { return false; } Project project = context.getProject(); PsiElement leaf = location.getPsiElement(); if (!RootKindMatcher.matches(leaf, RootKindFilter.projectAndLibrarySources)) { return false; } if (!(leaf.getContainingFile() instanceof KtFile ktFile)) { return false; } if (!JvmPlatformKt.isJvm(TargetPlatformDetectorUtils.getPlatform(ktFile))) { return false; } JavaTestEntity testEntity = TestNgKotlinTestFrameworkProvider.getInstance().getJavaTestEntity(leaf, true); if (testEntity == null) { return false; } return configure(configuration, location, context, project, testEntity.getTestClass(), testEntity.getTestMethod()); }