Package org.sonar.java.checks.helpers
Class UnitTestUtils
java.lang.Object
org.sonar.java.checks.helpers.UnitTestUtils
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic MethodMatchersstatic Patternstatic MethodMatchersstatic MethodMatchersMatch when we are sure that the intention is to assert something, that will result in an AssertionError if the assertion fails.static MethodMatchersstatic MethodMatchersstatic Pattern -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanstatic booleanhasNestedAnnotation(ClassTree tree)static booleanhasTestAnnotation(MethodTree tree)static booleanstatic booleanisTestClass(ClassTree classTree)static booleanisUnitTest(MethodTree methodTree)static boolean
-
Field Details
-
ASSERTION_METHODS_PATTERN
-
TEST_METHODS_PATTERN
-
ASSERTION_INVOCATION_MATCHERS
-
REACTIVE_X_TEST_METHODS
-
FAIL_METHOD_MATCHER
-
ASSERTIONS_METHOD_MATCHER
-
COMMON_ASSERTION_MATCHER
Match when we are sure that the intention is to assert something, that will result in an AssertionError if the assertion fails. The purpose is not to detect any assertion method (similar to S2699).
-
-
Method Details
-
hasNestedAnnotation
-
hasTestAnnotation
-
hasJUnit5TestAnnotation
-
isInUnitTestRelatedToObjectMethods
-
isUnitTestRelatedToObjectMethods
-
isUnitTest
-
isTestClass
-