Package com.consol.citrus.validation
Interface SchemaValidator<T extends SchemaValidationContext>
-
public interface SchemaValidator<T extends SchemaValidationContext>
-
-
Field Summary
Fields Modifier and Type Field Description static org.slf4j.LoggerLOGLoggerstatic StringRESOURCE_PATHSchema validator resource lookup pathstatic TypeResolverTYPE_RESOLVERType resolver to find custom schema validators on classpath via resource path lookup
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description static Map<String,SchemaValidator<? extends SchemaValidationContext>>lookup()Resolves all available validators from resource path lookup.static Optional<SchemaValidator<? extends SchemaValidationContext>>lookup(String validator)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 Detail
-
LOG
static final org.slf4j.Logger LOG
Logger
-
RESOURCE_PATH
static final String RESOURCE_PATH
Schema validator resource lookup path- See Also:
- Constant Field Values
-
TYPE_RESOLVER
static final TypeResolver TYPE_RESOLVER
Type resolver to find custom schema validators on classpath via resource path lookup
-
-
Method Detail
-
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 validatedcontext- The test context of the current test executionvalidationContext- The context of the validation to be used for the validation
-
-