Changing methods to lowercase so casing doesn't matter

Apex is case-insensitive so removing casing from the check for asserts.
This commit is contained in:
Jerome Russ
2016-11-08 16:27:27 -06:00
parent 35605a5801
commit 966d8f94f8

View File

@ -23,9 +23,9 @@ public class ApexUnitTestClassShouldHaveAsserts extends AbstractApexUnitTestRule
private static final Set<String> ASSERT_METHODS = new HashSet<>();
static {
ASSERT_METHODS.add("System.assert");
ASSERT_METHODS.add("System.assertEquals");
ASSERT_METHODS.add("System.assertNotEquals");
ASSERT_METHODS.add("system.assert");
ASSERT_METHODS.add("system.assertequals");
ASSERT_METHODS.add("system.assertnotequals");
}
@Override
@ -48,7 +48,7 @@ public class ApexUnitTestClassShouldHaveAsserts extends AbstractApexUnitTestRule
boolean isAssertFound = false;
for (final ASTMethodCallExpression methodCallExpression : methodCalls) {
if (ASSERT_METHODS.contains(methodCallExpression.getFullMethodName())) {
if (ASSERT_METHODS.contains(methodCallExpression.getFullMethodName().toLowerCase())) {
isAssertFound = true;
break;
}