in ddm-rrm-gerrit-integration/src/main/java/com/epam/digital/data/platform/management/gerritintegration/service/GerritServiceImpl.java [175:195]
public ChangeInfoDto getChangeInfo(String changeId) {
try {
ChangeInfo changeInfo = gerritApi.changes().id(changeId).get();
ChangeInfoDto changeInfoDto = gerritMapper.toChangeInfoDto(changeInfo);
String currentRevision = changeInfo.currentRevision;
RevisionInfo revisionInfo = changeInfo.revisions.get(currentRevision);
changeInfoDto.setRefs(revisionInfo.ref);
return changeInfoDto;
} 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 getting candidate with id " + changeId, ex);
}
} catch (RestApiException ex) {
throw new GerritCommunicationException(
"Something went wrong wile getting candidate with id " + changeId, ex);
}
}