Class JsonTextMessageValidator

All Implemented Interfaces:
MessageValidator<JsonMessageValidationContext>

public class JsonTextMessageValidator extends AbstractMessageValidator<JsonMessageValidationContext>
This message validator implementation is able to validate two JSON text objects. The order of JSON entries can differ as specified in JSON protocol. Tester defines an expected control JSON text with optional ignored entries.

JSONArray as well as nested JSONObjects are supported, too.

Validator offers two different modes to operate. By default, strict mode is set and the validator will also check the exact amount of control object fields to match. No additional fields in received JSON data structure will be accepted. In soft mode validator allows additional fields in received JSON data structure so the control JSON object can be a partial subset.

Author:
Christoph Deppisch