Package org.citrusframework.validation
Interface SchemaValidator<T extends SchemaValidationContext>
public interface SchemaValidator<T extends SchemaValidationContext>
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final org.slf4j.LoggerLoggerstatic final StringSchema validator resource lookup pathstatic final TypeResolverType resolver to find custom schema validators on classpath via resource path lookup -
Method Summary
Modifier and TypeMethodDescriptionstatic Map<String,SchemaValidator<? extends SchemaValidationContext>> lookup()Resolves all available validators from resource path lookup.static Optional<SchemaValidator<? extends SchemaValidationContext>>Resolves validator from resource path lookup with given validator resource name.booleansupportsMessageType(String messageType, Message message) voidvalidate(Message message, TestContext context, T validationContext) Validates the given message against schemas
-
Field Details
-
logger
static final org.slf4j.Logger loggerLogger -
RESOURCE_PATH
Schema validator resource lookup path- See Also:
-
TYPE_RESOLVER
Type resolver to find custom schema validators on classpath via resource path lookup
-
-
Method Details
-
lookup
Resolves all available validators from resource path lookup. Scans classpath for validator meta information and instantiates those validators.- Returns:
-
lookup
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
Validates the given message against schemas- Parameters:
message- The message to be validatedcontext- The test context of the current test executionvalidationContext- The context of the validation to be used for the validation
-
supportsMessageType
- Parameters:
messageType-message-- Returns:
- true if the message/message type can be validated by this validator
-