junit 5 for inspections: teach junit inspections to work over TestFramework

This commit is contained in:
Anna.Kozlova
2016-10-19 09:59:31 +02:00
parent 00a3814bd4
commit 8c19d2e0bd
11 changed files with 45 additions and 34 deletions
@@ -120,6 +120,7 @@ public class JUnitUtil {
if (psiMethod.getParameterList().getParametersCount() > 0) return false;
if (psiMethod.hasModifierProperty(PsiModifier.STATIC) && SUITE_METHOD_NAME.equals(psiMethod.getName())) return false;
if (!psiMethod.getName().startsWith("test")) return false;
if (psiMethod.hasModifierProperty(PsiModifier.STATIC)) return false;
PsiClass testCaseClass = getTestCaseClassOrNull(location);
return testCaseClass != null && psiMethod.getContainingClass().isInheritor(testCaseClass, true) && PsiType.VOID.equals(psiMethod.getReturnType());
}