Class UnitTestUtils


  • public final class UnitTestUtils
    extends Object
    • Field Detail

      • FAIL_METHOD_MATCHER

        public static final MethodMatchers FAIL_METHOD_MATCHER
      • ASSERTIONS_METHOD_MATCHER

        public static final MethodMatchers ASSERTIONS_METHOD_MATCHER
      • COMMON_ASSERTION_MATCHER

        public static final MethodMatchers 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 Detail

      • hasNestedAnnotation

        public static boolean hasNestedAnnotation​(ClassTree tree)
      • hasTestAnnotation

        public static boolean hasTestAnnotation​(MethodTree tree)
      • hasJUnit5TestAnnotation

        public static boolean hasJUnit5TestAnnotation​(MethodTree tree)
      • isInUnitTestRelatedToObjectMethods

        public static boolean isInUnitTestRelatedToObjectMethods​(ExpressionTree expr)
      • isUnitTestRelatedToObjectMethods

        public static boolean isUnitTestRelatedToObjectMethods​(@Nullable
                                                               MethodTree method)