use of io.irontest.models.assertion.AllHTTPStubRequestsMatchedAssertionVerificationResult in project irontest by zheng-wang.
the class AllHTTPStubRequestsMatchedAssertionVerifier method verify.
@Override
public AssertionVerificationResult verify(Object... inputs) {
AllHTTPStubRequestsMatchedAssertionVerificationResult result = new AllHTTPStubRequestsMatchedAssertionVerificationResult();
List<ServeEvent> allStubRequests = (List<ServeEvent>) inputs[0];
List<ServeEvent> unmatchedStubRequests = new ArrayList<>();
for (ServeEvent serveEvent : allStubRequests) {
if (!serveEvent.getWasMatched()) {
unmatchedStubRequests.add(serveEvent);
}
}
result.setUnmatchedStubRequests(unmatchedStubRequests);
if (unmatchedStubRequests.isEmpty()) {
result.setResult(TestResult.PASSED);
} else {
result.setResult(TestResult.FAILED);
}
return result;
}
Aggregations