Search in sources :

Example 1 with JsonTextMessageValidator

use of com.consol.citrus.validation.json.JsonTextMessageValidator in project fabric8-maven-plugin by fabric8io.

the class Verify method verifyResourceDescriptors.

public static void verifyResourceDescriptors(File actualPath, File expectedPath, boolean strict) throws IOException, ParseException {
    String actualText = readFile(actualPath);
    String expectedText = readFile(expectedPath);
    JsonTextMessageValidator validator = new JsonTextMessageValidator();
    validator.setStrict(strict);
    DocumentContext actualContext = JsonPath.parse(actualText);
    validator.validateJson(newMessage(actualText), newMessage(expectedText), new JsonMessageValidationContext(), createTestContext(), actualContext);
}
Also used : JsonTextMessageValidator(com.consol.citrus.validation.json.JsonTextMessageValidator) JsonMessageValidationContext(com.consol.citrus.validation.json.JsonMessageValidationContext) DocumentContext(com.jayway.jsonpath.DocumentContext)

Aggregations

JsonMessageValidationContext (com.consol.citrus.validation.json.JsonMessageValidationContext)1 JsonTextMessageValidator (com.consol.citrus.validation.json.JsonTextMessageValidator)1 DocumentContext (com.jayway.jsonpath.DocumentContext)1