Class JsonSchemaValidation
java.lang.Object
org.citrusframework.validation.json.schema.JsonSchemaValidation
- All Implemented Interfaces:
SchemaValidator<JsonMessageValidationContext>
public class JsonSchemaValidation
extends Object
implements SchemaValidator<JsonMessageValidationContext>
This class is responsible for the validation of json messages against json schemas / json schema repositories.
- Since:
- 2.7.3
-
Field Summary
Fields inherited from interface org.citrusframework.validation.SchemaValidator
RESOURCE_PATH, TYPE_RESOLVER -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor using default filter.JsonSchemaValidation(JsonSchemaFilter jsonSchemaFilter) Constructor using filter implementation. -
Method Summary
Modifier and TypeMethodDescriptionbooleansupportsMessageType(String messageType, Message message) Checks whether the supplied message type is supported by the message.validate(Message message, List<JsonSchemaRepository> schemaRepositories, JsonMessageValidationContext validationContext, ReferenceResolver referenceResolver) Validates the given message against a list of JsonSchemaRepositories under consideration of the actual contextvoidvalidate(Message message, TestContext context, JsonMessageValidationContext validationContext)
-
Constructor Details
-
JsonSchemaValidation
public JsonSchemaValidation()Default constructor using default filter. -
JsonSchemaValidation
Constructor using filter implementation.
-
-
Method Details
-
validate
public void validate(Message message, TestContext context, JsonMessageValidationContext validationContext) - Specified by:
validatein interfaceSchemaValidator<JsonMessageValidationContext>
-
validate
public GraciousProcessingReport validate(Message message, List<JsonSchemaRepository> schemaRepositories, JsonMessageValidationContext validationContext, ReferenceResolver referenceResolver) Validates the given message against a list of JsonSchemaRepositories under consideration of the actual context- Parameters:
message- The message to be validatedschemaRepositories- The schema repositories to be used for validationvalidationContext- The context of the validation to be used for the validationreferenceResolver- holding bean references for lookup.- Returns:
- A report holding the results of the validation
-
supportsMessageType
Checks whether the supplied message type is supported by the message.- Specified by:
supportsMessageTypein interfaceSchemaValidator<JsonMessageValidationContext>- Parameters:
messageType- the message type to checkmessage- the message- Returns:
- true if the message or message type is supported by this validator
-