Interface SchemaValidator<T extends SchemaValidationContext>


public interface SchemaValidator<T extends SchemaValidationContext>
  • Field Details

    • logger

      static final org.slf4j.Logger logger
      Logger
    • RESOURCE_PATH

      static final String RESOURCE_PATH
      Schema validator resource lookup path
      See Also:
    • TYPE_RESOLVER

      static final TypeResolver TYPE_RESOLVER
      Type resolver to find custom schema validators on classpath via resource path lookup
  • Method Details

    • lookup

      static Map<String,SchemaValidator<? extends SchemaValidationContext>> lookup()
      Resolves all available validators from resource path lookup. Scans classpath for validator meta information and instantiates those validators.
      Returns:
    • lookup

      static Optional<SchemaValidator<? extends SchemaValidationContext>> lookup(String validator)
      Resolves validator from resource path lookup with given validator resource name. Scans classpath for validator meta information with given name and returns instance of validator. Returns optional instead of throwing exception when no validator could be found.
      Parameters:
      validator -
      Returns:
    • validate

      void validate(Message message, TestContext context, T validationContext)
      Validates the given message against schemas
      Parameters:
      message - The message to be validated
      context - The test context of the current test execution
      validationContext - The context of the validation to be used for the validation
    • supportsMessageType

      boolean supportsMessageType(String messageType, Message message)
      Parameters:
      messageType -
      message -
      Returns:
      true if the message/message type can be validated by this validator