Class CategoryValidator

java.lang.Object
org.junit.validator.AnnotationValidator
org.junit.experimental.categories.CategoryValidator

public final class CategoryValidator extends AnnotationValidator
Validates that there are no errors in the use of the Category annotation. If there is, a Throwable object will be added to the list of errors.
Since:
4.12
  • Field Details

    • INCOMPATIBLE_ANNOTATIONS

      private static final Set<Class<? extends Annotation>> INCOMPATIBLE_ANNOTATIONS
  • Constructor Details

    • CategoryValidator

      public CategoryValidator()
  • Method Details

    • validateAnnotatedMethod

      public List<Exception> validateAnnotatedMethod(FrameworkMethod method)
      Adds to errors a throwable for each problem detected. Looks for BeforeClass, AfterClass, Before and After annotations.
      Overrides:
      validateAnnotatedMethod in class AnnotationValidator
      Parameters:
      method - the method that is being validated
      Returns:
      A list of exceptions detected
      Since:
      4.12
    • addErrorMessage

      private void addErrorMessage(List<Exception> errors, Class<?> clazz)