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);
}
Aggregations