in ddm-rrm-gerrit-integration/src/main/java/com/epam/digital/data/platform/management/gerritintegration/service/GerritServiceImpl.java [311:332]
public Boolean review(String changeId) {
ReviewInput reviewInput = new ReviewInput();
reviewInput.reviewer(gerritPropertiesConfig.getUser(), ReviewerState.REVIEWER, true);
reviewInput.label(CODE_REVIEW_LABEL, CODE_REVIEW_VALUE);
reviewInput.label(VERIFIED_LABEL, VERIFIED_VALUE);
reviewInput.ready = true;
try {
ReviewResult review = gerritApi.changes().id(changeId).current().review(reviewInput);
return review.ready;
} catch (HttpStatusException ex) {
if (ex.getStatusCode() == HttpStatus.NOT_FOUND.value()) {
throw new GerritChangeNotFoundException("Could not found candidate with id " + changeId,
ex);
} else {
throw new GerritCommunicationException(
"Something went wrong wile reviewing candidate with id " + changeId, ex);
}
} catch (RestApiException ex) {
throw new GerritCommunicationException(
"Something went wrong wile reviewing candidate with id " + changeId, ex);
}
}