Search in sources :

Example 1 with ValidationResult

use of nl.knaw.huygens.concordion.extensions.ValidationResult in project timbuctoo by HuygensING.

the class AbstractV2_1EndpointFixture method validate.

protected ValidationResult validate(ExpectedResult expectation, ActualResult reality) {
    Tuple<Boolean, String> statusResult = testStatus(expectation, reality);
    String result = statusResult.getRight();
    DiffResult headersResult = ExpectedHeadersAreEqualValidator.validate(expectation.getHeaders(), reality.getMultiHeaders());
    result += headersResult.asHtml();
    ValidationResult bodyResult = validateBody(expectation, reality);
    if (bodyResult.getMessage().length() > 0) {
        result += "\n";
    }
    result += bodyResult.getMessage();
    result = "<pre>" + result + "</pre>";
    return ValidationResult.xmlResult(statusResult.getLeft() && headersResult.wasSuccess() && bodyResult.isSucceeded(), result);
}
Also used : DiffResult(nl.knaw.huygens.contractdiff.diffresults.DiffResult) ValidationResult(nl.knaw.huygens.concordion.extensions.ValidationResult)

Aggregations

ValidationResult (nl.knaw.huygens.concordion.extensions.ValidationResult)1 DiffResult (nl.knaw.huygens.contractdiff.diffresults.DiffResult)1