use of com.google.gerrit.server.change.GetRelated.ChangeAndCommit in project gerrit by GerritCodeReview.
the class GetRelatedIT method assertRelated.
private void assertRelated(PatchSet.Id psId, ChangeAndCommit... expected) throws Exception {
List<ChangeAndCommit> actual = getRelated(psId);
assertThat(actual).named("related to " + psId).hasSize(expected.length);
for (int i = 0; i < actual.size(); i++) {
String name = "index " + i + " related to " + psId;
ChangeAndCommit a = actual.get(i);
ChangeAndCommit e = expected[i];
assertThat(a._changeNumber).named("change ID of " + name).isEqualTo(e._changeNumber);
// Don't bother checking changeId; assume _changeNumber is sufficient.
assertThat(a._revisionNumber).named("revision of " + name).isEqualTo(e._revisionNumber);
assertThat(a.commit.commit).named("commit of " + name).isEqualTo(e.commit.commit);
assertThat(a._currentRevisionNumber).named("current revision of " + name).isEqualTo(e._currentRevisionNumber);
}
}
use of com.google.gerrit.server.change.GetRelated.ChangeAndCommit in project gerrit by GerritCodeReview.
the class GetRelatedIT method changeAndCommit.
private static ChangeAndCommit changeAndCommit(PatchSet.Id psId, ObjectId commitId, int currentRevisionNum) {
ChangeAndCommit result = new ChangeAndCommit();
result._changeNumber = psId.getParentKey().get();
result.commit = new CommitInfo();
result.commit.commit = commitId.name();
result._revisionNumber = psId.get();
result._currentRevisionNumber = currentRevisionNum;
result.status = "NEW";
return result;
}
Aggregations