use of org.openkilda.testing.service.traffexam.model.EndpointReport in project open-kilda by telstra.
the class TraffExamServiceImpl method fetchReport.
@Override
public ExamReport fetchReport(Exam exam) throws NoResultsFoundException, ExamNotFinishedException {
ExamResources resources = retrieveExamResources(exam);
EndpointReport producerReport = fetchEndpointReport(resources.getProducer());
EndpointReport consumerReport;
try {
consumerReport = fetchEndpointReport(resources.getConsumer());
} catch (ExamNotFinishedException e) {
if (producerReport.getError() == null) {
throw e;
}
consumerReport = new EndpointReport("Don't wait for consumer report due to error on producer side");
}
return new ExamReport(exam, producerReport, consumerReport);
}
use of org.openkilda.testing.service.traffexam.model.EndpointReport in project open-kilda by telstra.
the class TraffExamServiceImpl method fetchEndpointReport.
private EndpointReport fetchEndpointReport(Endpoint endpoint) throws NoResultsFoundException, ExamNotFinishedException {
checkHostRelation(endpoint, suppliedEndpoints);
ReportResponse report = restTemplate.getForObject(makeHostUri(endpoint.getHost()).path("endpoint/").path(endpoint.getId().toString()).path("/report").build(), ReportResponse.class);
if (report.getStatus() == null) {
throw new ExamNotFinishedException();
}
return new EndpointReport(report);
}
Aggregations