use of com.google.gerrit.extensions.api.changes.FixInput in project gerrit by GerritCodeReview.
the class ConsistencyCheckerIT method patchSetObjectAndRefMissingWithDeletingPatchSet.
@Test
public void patchSetObjectAndRefMissingWithDeletingPatchSet() throws Exception {
ChangeNotes notes = insertChange();
PatchSet ps1 = psUtil.current(notes);
String rev2 = "deadbeefdeadbeefdeadbeefdeadbeefdeadbeef";
PatchSet ps2 = insertMissingPatchSet(notes, rev2);
notes = reload(notes);
FixInput fix = new FixInput();
fix.deletePatchSetIfCommitMissing = true;
assertProblems(notes, fix, problem("Ref missing: " + ps2.id().toRefName()), problem("Object missing: patch set 2: " + rev2, FIXED, "Deleted patch set"));
notes = reload(notes);
assertThat(notes.getChange().currentPatchSetId().get()).isEqualTo(1);
assertThat(psUtil.get(notes, ps1.id())).isNotNull();
assertThat(psUtil.get(notes, ps2.id())).isNull();
}
use of com.google.gerrit.extensions.api.changes.FixInput in project gerrit by GerritCodeReview.
the class ConsistencyCheckerIT method newChangeIsMergedWithFix.
@Test
public void newChangeIsMergedWithFix() throws Exception {
ChangeNotes notes = insertChange();
ObjectId commitId = psUtil.current(notes).commitId();
serverSideTestRepo.branch(notes.getChange().getDest().branch()).update(serverSideTestRepo.getRevWalk().parseCommit(commitId));
assertProblems(notes, new FixInput(), problem("Patch set 1 (" + commitId.name() + ") is merged into destination ref" + " refs/heads/master (" + commitId.name() + "), but change status is NEW", FIXED, "Marked change as merged"));
notes = reload(notes);
assertThat(notes.getChange().isMerged()).isTrue();
assertNoProblems(notes, null);
}
Aggregations