class JsonPathChecker implements ConditionChecker {

    @Override
    public boolean checkCondition(final WilmaHttpRequest request, final ParameterList parameters) {
        String expected = parameters.get(EXPECTED_KEY);
        String path = parameters.get(JSONPATH_KEY);
        boolean equals;
        try {
            String actualValue = JsonPath.read(request.getBody(), path);
            equals = evaluate(expected, actualValue);
        } catch (Exception e) {
            logger.debug("Request body isn't of JSON format, message:" + request.getWilmaMessageLoggerId(), e);
            equals = false;
        }
        return equals;
    }

}