junit method with valid signature: skip utilities

don't warn about non-public methods with parameters even when they start with test
This commit is contained in:
Anna Kozlova
2017-08-19 13:58:26 +02:00
parent 5bfac5f685
commit 2726465602
2 changed files with 5 additions and 1 deletions
@@ -93,7 +93,8 @@ public class TestUtils {
}
final String methodName = method.getName();
@NonNls final String test = "test";
if (!methodName.startsWith(test)) {
if (!methodName.startsWith(test) ||
!method.hasModifierProperty(PsiModifier.PUBLIC) && method.getParameterList().getParametersCount() > 0) {
return false;
}
final PsiClass containingClass = method.getContainingClass();
@@ -13,4 +13,7 @@ public class JUnit3TestMethodIsPublicVoidNoArg extends junit.framework.TestCase
public void <warning descr="Test method 'testFour()' should probably not have parameters">testFour</warning>(int i) {}
public void testFive() {}
//ignore when method doesn't look like test anymore
void testSix(int i) {}
}