use of com.epam.ta.reportportal.ws.model.ErrorType.PROJECT_NOT_FOUND in project service-api by reportportal.
the class AbstractStatusChangingStrategy method changeStatus.
@Override
public void changeStatus(TestItem testItem, StatusEnum providedStatus, ReportPortalUser user) {
BusinessRule.expect(testItem.getItemResults().getStatus(), currentStatus -> !IN_PROGRESS.equals(currentStatus)).verify(INCORRECT_REQUEST, Suppliers.formattedSupplier("Unable to update status of test item = '{}' because of '{}' status", testItem.getItemId(), testItem.getItemResults().getStatus()).get());
if (providedStatus == testItem.getItemResults().getStatus()) {
return;
}
Launch launch = testItemService.getEffectiveLaunch(testItem);
Project project = projectRepository.findById(launch.getProjectId()).orElseThrow(() -> new ReportPortalException(PROJECT_NOT_FOUND, launch.getProjectId()));
updateStatus(project, launch, testItem, providedStatus, user);
}
Aggregations