Search in sources :

Example 11 with BackfillResult

use of com.google.gerrit.server.notedb.CommitRewriter.BackfillResult in project gerrit by GerritCodeReview.

the class CommitRewriterTest method fixSubmitChangeMessageAndFooters.

// TODO(issue-15517): Fix the JdkObsolete issue with Date once JGit's PersonIdent class supports
// Instants
@SuppressWarnings("JdkObsolete")
@Test
public void fixSubmitChangeMessageAndFooters() throws Exception {
    Change c = newChange();
    PersonIdent invalidAuthorIdent = new PersonIdent(changeOwner.getName(), changeNoteUtil.getAccountIdAsEmailAddress(changeOwner.getAccountId()), Date.from(TimeUtil.now()), serverIdent.getTimeZone());
    String changeOwnerIdentToFix = getAccountIdentToFix(changeOwner.getAccount());
    writeUpdate(RefNames.changeMetaRef(c.getId()), getChangeUpdateBody(c, "Change has been successfully merged by " + changeOwner.getName(), "Status: merged", "Tag: autogenerated:gerrit:merged", "Reviewer: " + changeOwnerIdentToFix, "Label: SUBM=+1", "Submission-id: 6310-1521542139810-cfb7e159", "Submitted-with: OK", "Submitted-with: OK: Code-Review: " + changeOwnerIdentToFix), invalidAuthorIdent);
    RunOptions options = new RunOptions();
    options.dryRun = false;
    BackfillResult result = rewriter.backfillProject(project, repo, options);
    assertThat(result.fixedRefDiff.keySet()).containsExactly(RefNames.changeMetaRef(c.getId()));
    List<String> commitHistoryDiff = commitHistoryDiff(result, c.getId());
    assertThat(commitHistoryDiff).containsExactly("@@ -1 +1 @@\n" + "-author Change Owner <1@gerrit> 1254344405 -0700\n" + "+author Gerrit User 1 <1@gerrit> 1254344405 -0700\n" + "@@ -6 +6 @@\n" + "-Change has been successfully merged by Change Owner\n" + "+Change has been successfully merged\n" + "@@ -11 +11 @@\n" + "-Reviewer: Change Owner <1@gerrit>\n" + "+Reviewer: Gerrit User 1 <1@gerrit>\n" + "@@ -15 +15 @@\n" + "-Submitted-with: OK: Code-Review: Change Owner <1@gerrit>\n" + "+Submitted-with: OK: Code-Review: Gerrit User 1 <1@gerrit>\n");
    BackfillResult secondRunResult = rewriter.backfillProject(project, repo, options);
    assertThat(secondRunResult.fixedRefDiff.keySet()).isEmpty();
    assertThat(secondRunResult.refsFailedToFix).isEmpty();
}
Also used : BackfillResult(com.google.gerrit.server.notedb.CommitRewriter.BackfillResult) PersonIdent(org.eclipse.jgit.lib.PersonIdent) Change(com.google.gerrit.entities.Change) RunOptions(com.google.gerrit.server.notedb.CommitRewriter.RunOptions) Test(org.junit.Test)

Example 12 with BackfillResult

use of com.google.gerrit.server.notedb.CommitRewriter.BackfillResult in project gerrit by GerritCodeReview.

the class CommitRewriterTest method fixAssigneeFooterIdent.

@Test
public void fixAssigneeFooterIdent() throws Exception {
    Change c = newChange();
    String assigneeIdentToFix = getAccountIdentToFix(changeOwner.getAccount());
    RevCommit invalidUpdateCommit = writeUpdate(RefNames.changeMetaRef(c.getId()), getChangeUpdateBody(c, "Assignee added", "Assignee: " + assigneeIdentToFix), getAuthorIdent(changeOwner.getAccount()));
    ChangeUpdate changeAssigneeUpdate = newUpdate(c, changeOwner);
    changeAssigneeUpdate.setAssignee(otherUserId);
    changeAssigneeUpdate.commit();
    ChangeUpdate removeAssigneeUpdate = newUpdate(c, changeOwner);
    removeAssigneeUpdate.removeAssignee();
    removeAssigneeUpdate.commit();
    Ref metaRefBeforeRewrite = repo.exactRef(RefNames.changeMetaRef(c.getId()));
    ImmutableList<RevCommit> commitsBeforeRewrite = logMetaRef(repo, metaRefBeforeRewrite);
    int invalidCommitIndex = commitsBeforeRewrite.indexOf(invalidUpdateCommit);
    ChangeNotes notesBeforeRewrite = newNotes(c);
    RunOptions options = new RunOptions();
    options.dryRun = false;
    BackfillResult result = rewriter.backfillProject(project, repo, options);
    assertThat(result.fixedRefDiff.keySet()).containsExactly(RefNames.changeMetaRef(c.getId()));
    ChangeNotes notesAfterRewrite = newNotes(c);
    assertThat(notesBeforeRewrite.getPastAssignees()).containsExactly(changeOwner.getAccountId(), otherUser.getAccountId());
    assertThat(notesBeforeRewrite.getChange().getAssignee()).isNull();
    assertThat(notesAfterRewrite.getPastAssignees()).containsExactly(changeOwner.getAccountId(), otherUser.getAccountId());
    assertThat(notesAfterRewrite.getChange().getAssignee()).isNull();
    Ref metaRefAfterRewrite = repo.exactRef(RefNames.changeMetaRef(c.getId()));
    assertThat(metaRefAfterRewrite.getObjectId()).isNotEqualTo(metaRefBeforeRewrite.getObjectId());
    ImmutableList<RevCommit> commitsAfterRewrite = logMetaRef(repo, metaRefAfterRewrite);
    assertValidCommits(commitsBeforeRewrite, commitsAfterRewrite, ImmutableList.of(invalidCommitIndex));
    assertFixedCommits(ImmutableList.of(invalidUpdateCommit.getId()), result, c.getId());
    RevCommit fixedUpdateCommit = commitsAfterRewrite.get(invalidCommitIndex);
    assertThat(invalidUpdateCommit.getAuthorIdent()).isEqualTo(fixedUpdateCommit.getAuthorIdent());
    assertThat(invalidUpdateCommit.getCommitterIdent()).isEqualTo(fixedUpdateCommit.getCommitterIdent());
    assertThat(invalidUpdateCommit.getFullMessage()).isNotEqualTo(fixedUpdateCommit.getFullMessage());
    assertThat(fixedUpdateCommit.getFullMessage()).doesNotContain(changeOwner.getName());
    assertThat(invalidUpdateCommit.getFullMessage()).contains(assigneeIdentToFix);
    String expectedFixedIdent = getValidIdentAsString(changeOwner.getAccount());
    assertThat(fixedUpdateCommit.getFullMessage()).contains(expectedFixedIdent);
    List<String> commitHistoryDiff = commitHistoryDiff(result, c.getId());
    assertThat(commitHistoryDiff).containsExactly("@@ -9 +9 @@\n" + "-Assignee: Change Owner <1@gerrit>\n" + "+Assignee: Gerrit User 1 <1@gerrit>\n");
    BackfillResult secondRunResult = rewriter.backfillProject(project, repo, options);
    assertThat(secondRunResult.fixedRefDiff.keySet()).isEmpty();
    assertThat(secondRunResult.refsFailedToFix).isEmpty();
}
Also used : Ref(org.eclipse.jgit.lib.Ref) BackfillResult(com.google.gerrit.server.notedb.CommitRewriter.BackfillResult) Change(com.google.gerrit.entities.Change) RunOptions(com.google.gerrit.server.notedb.CommitRewriter.RunOptions) RevCommit(org.eclipse.jgit.revwalk.RevCommit) Test(org.junit.Test)

Example 13 with BackfillResult

use of com.google.gerrit.server.notedb.CommitRewriter.BackfillResult in project gerrit by GerritCodeReview.

the class CommitRewriterTest method fixLabelFooterIdent.

// TODO(issue-15517): Fix the JdkObsolete issue with Date once JGit's PersonIdent class supports
// Instants
@SuppressWarnings("JdkObsolete")
@Test
public void fixLabelFooterIdent() throws Exception {
    Change c = newChange();
    String approverIdentToFix = getAccountIdentToFix(otherUser.getAccount());
    String changeOwnerIdentToFix = getAccountIdentToFix(changeOwner.getAccount());
    ChangeUpdate approvalUpdateByOtherUser = newUpdate(c, otherUser);
    approvalUpdateByOtherUser.putApproval(VERIFIED, (short) -1);
    approvalUpdateByOtherUser.commit();
    ImmutableList<ObjectId> commitsToFix = new ImmutableList.Builder<ObjectId>().add(writeUpdate(RefNames.changeMetaRef(c.getId()), getChangeUpdateBody(c, /*changeMessage=*/
    null, "Label: -Verified " + approverIdentToFix, "Label: Custom-Label-1=-1 " + approverIdentToFix, "Label: Verified=+1", "Label: Custom-Label-1=+1", "Label: Custom-Label-2=+2 " + approverIdentToFix, "Label: Custom-Label-3=0 " + approverIdentToFix), getAuthorIdent(changeOwner.getAccount()))).add(writeUpdate(RefNames.changeMetaRef(c.getId()), getChangeUpdateBody(c, /*changeMessage=*/
    null, "Label: -Verified " + changeOwnerIdentToFix, "Label: Custom-Label-1=+1"), getAuthorIdent(otherUser.getAccount()))).build();
    Ref metaRefBeforeRewrite = repo.exactRef(RefNames.changeMetaRef(c.getId()));
    ImmutableList<RevCommit> commitsBeforeRewrite = logMetaRef(repo, metaRefBeforeRewrite);
    ImmutableList<Integer> invalidCommits = commitsToFix.stream().map(commit -> commitsBeforeRewrite.indexOf(commit)).collect(toImmutableList());
    ChangeNotes notesBeforeRewrite = newNotes(c);
    RunOptions options = new RunOptions();
    options.dryRun = false;
    BackfillResult result = rewriter.backfillProject(project, repo, options);
    assertThat(result.fixedRefDiff.keySet()).containsExactly(RefNames.changeMetaRef(c.getId()));
    Instant updateTimestamp = serverIdent.getWhen().toInstant();
    ImmutableList<PatchSetApproval> expectedApprovals = ImmutableList.of(PatchSetApproval.builder().key(PatchSetApproval.key(c.currentPatchSetId(), changeOwner.getAccountId(), LabelId.create(VERIFIED))).value(0).granted(updateTimestamp).build(), PatchSetApproval.builder().key(PatchSetApproval.key(c.currentPatchSetId(), changeOwner.getAccountId(), LabelId.create("Custom-Label-1"))).value(+1).granted(updateTimestamp).build(), PatchSetApproval.builder().key(PatchSetApproval.key(c.currentPatchSetId(), otherUserId, LabelId.create(VERIFIED))).value(0).granted(updateTimestamp).build(), PatchSetApproval.builder().key(PatchSetApproval.key(c.currentPatchSetId(), otherUserId, LabelId.create("Custom-Label-1"))).value(+1).granted(updateTimestamp).build(), PatchSetApproval.builder().key(PatchSetApproval.key(c.currentPatchSetId(), otherUserId, LabelId.create("Custom-Label-2"))).value(+2).granted(updateTimestamp).build(), PatchSetApproval.builder().key(PatchSetApproval.key(c.currentPatchSetId(), otherUserId, LabelId.create("Custom-Label-3"))).value(0).granted(updateTimestamp).build());
    ChangeNotes notesAfterRewrite = newNotes(c);
    assertThat(notesBeforeRewrite.getApprovals().get(c.currentPatchSetId())).containsExactlyElementsIn(expectedApprovals);
    assertThat(notesAfterRewrite.getApprovals().get(c.currentPatchSetId())).containsExactlyElementsIn(expectedApprovals);
    Ref metaRefAfterRewrite = repo.exactRef(RefNames.changeMetaRef(c.getId()));
    assertThat(metaRefAfterRewrite.getObjectId()).isNotEqualTo(metaRefBeforeRewrite.getObjectId());
    ImmutableList<RevCommit> commitsAfterRewrite = logMetaRef(repo, metaRefAfterRewrite);
    assertValidCommits(commitsBeforeRewrite, commitsAfterRewrite, invalidCommits);
    assertFixedCommits(commitsToFix, result, c.getId());
    List<String> commitHistoryDiff = commitHistoryDiff(result, c.getId());
    assertThat(commitHistoryDiff).containsExactly("@@ -7,2 +7,2 @@\n" + "-Label: -Verified Other Account <2@gerrit>\n" + "-Label: Custom-Label-1=-1 Other Account <2@gerrit>\n" + "+Label: -Verified Gerrit User 2 <2@gerrit>\n" + "+Label: Custom-Label-1=-1 Gerrit User 2 <2@gerrit>\n" + "@@ -11,2 +11,2 @@\n" + "-Label: Custom-Label-2=+2 Other Account <2@gerrit>\n" + "-Label: Custom-Label-3=0 Other Account <2@gerrit>\n" + "+Label: Custom-Label-2=+2 Gerrit User 2 <2@gerrit>\n" + "+Label: Custom-Label-3=0 Gerrit User 2 <2@gerrit>\n", "@@ -7 +7 @@\n" + "-Label: -Verified Change Owner <1@gerrit>\n" + "+Label: -Verified Gerrit User 1 <1@gerrit>\n");
    BackfillResult secondRunResult = rewriter.backfillProject(project, repo, options);
    assertThat(secondRunResult.fixedRefDiff.keySet()).isEmpty();
    assertThat(secondRunResult.refsFailedToFix).isEmpty();
}
Also used : Arrays(java.util.Arrays) Date(java.util.Date) Inject(com.google.inject.Inject) ReceiveCommand(org.eclipse.jgit.transport.ReceiveCommand) CommitDiff(com.google.gerrit.server.notedb.CommitRewriter.CommitDiff) RevWalk(org.eclipse.jgit.revwalk.RevWalk) PatchSetApproval(com.google.gerrit.entities.PatchSetApproval) OutputFormat(com.google.gerrit.json.OutputFormat) Gson(com.google.gson.Gson) AttentionSetUpdate(com.google.gerrit.entities.AttentionSetUpdate) Map(java.util.Map) After(org.junit.After) RefNames(com.google.gerrit.entities.RefNames) RefUpdateUtil(com.google.gerrit.git.RefUpdateUtil) ImmutableMap(com.google.common.collect.ImmutableMap) ImmutableList.toImmutableList(com.google.common.collect.ImmutableList.toImmutableList) Account(com.google.gerrit.entities.Account) Set(java.util.Set) RevSort(org.eclipse.jgit.revwalk.RevSort) ReviewerStatusUpdate(com.google.gerrit.server.ReviewerStatusUpdate) Instant(java.time.Instant) SubmitRecord(com.google.gerrit.entities.SubmitRecord) PersonIdent(org.eclipse.jgit.lib.PersonIdent) List(java.util.List) BatchRefUpdate(org.eclipse.jgit.lib.BatchRefUpdate) VERIFIED(com.google.gerrit.entities.LabelId.VERIFIED) Ref(org.eclipse.jgit.lib.Ref) IntStream(java.util.stream.IntStream) LabelId(com.google.gerrit.entities.LabelId) RevCommit(org.eclipse.jgit.revwalk.RevCommit) CC(com.google.gerrit.server.notedb.ReviewerStateInternal.CC) HashSet(java.util.HashSet) ChangeMessage(com.google.gerrit.entities.ChangeMessage) ImmutableList(com.google.common.collect.ImmutableList) CODE_REVIEW(com.google.gerrit.entities.LabelId.CODE_REVIEW) Objects.requireNonNull(java.util.Objects.requireNonNull) Change(com.google.gerrit.entities.Change) REVIEWER(com.google.gerrit.server.notedb.ReviewerStateInternal.REVIEWER) Before(org.junit.Before) Operation(com.google.gerrit.entities.AttentionSetUpdate.Operation) CurrentUser(com.google.gerrit.server.CurrentUser) AttentionStatusInNoteDb(com.google.gerrit.server.notedb.ChangeNoteUtil.AttentionStatusInNoteDb) BackfillResult(com.google.gerrit.server.notedb.CommitRewriter.BackfillResult) Test(org.junit.Test) Truth.assertThat(com.google.common.truth.Truth.assertThat) ObjectId(org.eclipse.jgit.lib.ObjectId) AccountTemplateUtil(com.google.gerrit.server.util.AccountTemplateUtil) IdentifiedUser(com.google.gerrit.server.IdentifiedUser) TimeUtil(com.google.gerrit.server.util.time.TimeUtil) REMOVED(com.google.gerrit.server.notedb.ReviewerStateInternal.REMOVED) RunOptions(com.google.gerrit.server.notedb.CommitRewriter.RunOptions) Repository(org.eclipse.jgit.lib.Repository) BackfillResult(com.google.gerrit.server.notedb.CommitRewriter.BackfillResult) ObjectId(org.eclipse.jgit.lib.ObjectId) ImmutableList.toImmutableList(com.google.common.collect.ImmutableList.toImmutableList) ImmutableList(com.google.common.collect.ImmutableList) Instant(java.time.Instant) Change(com.google.gerrit.entities.Change) PatchSetApproval(com.google.gerrit.entities.PatchSetApproval) Ref(org.eclipse.jgit.lib.Ref) RunOptions(com.google.gerrit.server.notedb.CommitRewriter.RunOptions) RevCommit(org.eclipse.jgit.revwalk.RevCommit) Test(org.junit.Test)

Example 14 with BackfillResult

use of com.google.gerrit.server.notedb.CommitRewriter.BackfillResult in project gerrit by GerritCodeReview.

the class CommitRewriterTest method numRefs_greater_maxRefsToUpdate_allFixed.

@Test
public void numRefs_greater_maxRefsToUpdate_allFixed() throws Exception {
    int numberOfChanges = 12;
    ImmutableMap.Builder<String, Ref> refsToOldMetaBuilder = new ImmutableMap.Builder<>();
    for (int i = 0; i < numberOfChanges; i++) {
        Change c = newChange();
        ChangeUpdate update = newUpdate(c, changeOwner);
        update.setChangeMessage("Change has been successfully merged by " + changeOwner.getName());
        update.commit();
        ChangeUpdate updateWithSubject = newUpdate(c, changeOwner);
        updateWithSubject.setSubjectForCommit("Update with subject");
        updateWithSubject.commit();
        String refName = RefNames.changeMetaRef(c.getId());
        Ref metaRefBeforeRewrite = repo.exactRef(refName);
        refsToOldMetaBuilder.put(refName, metaRefBeforeRewrite);
    }
    ImmutableMap<String, Ref> refsToOldMeta = refsToOldMetaBuilder.build();
    RunOptions options = new RunOptions();
    options.dryRun = false;
    options.outputDiff = false;
    options.verifyCommits = false;
    options.maxRefsInBatch = 10;
    options.maxRefsToUpdate = 12;
    BackfillResult backfillResult = rewriter.backfillProject(project, repo, options);
    assertThat(backfillResult.fixedRefDiff.keySet()).isEqualTo(refsToOldMeta.keySet());
    for (Map.Entry<String, Ref> refEntry : refsToOldMeta.entrySet()) {
        Ref metaRefAfterRewrite = repo.exactRef(refEntry.getKey());
        assertThat(refEntry.getValue()).isNotEqualTo(metaRefAfterRewrite);
    }
}
Also used : BackfillResult(com.google.gerrit.server.notedb.CommitRewriter.BackfillResult) Change(com.google.gerrit.entities.Change) ImmutableMap(com.google.common.collect.ImmutableMap) Ref(org.eclipse.jgit.lib.Ref) Map(java.util.Map) ImmutableMap(com.google.common.collect.ImmutableMap) RunOptions(com.google.gerrit.server.notedb.CommitRewriter.RunOptions) Test(org.junit.Test)

Example 15 with BackfillResult

use of com.google.gerrit.server.notedb.CommitRewriter.BackfillResult in project gerrit by GerritCodeReview.

the class CommitRewriterTest method fixSubmittedWithFooterIdent.

@Test
public void fixSubmittedWithFooterIdent() throws Exception {
    Change c = newChange();
    ChangeUpdate preSubmitUpdate = newUpdate(c, changeOwner);
    preSubmitUpdate.setChangeMessage("Per-submit update");
    preSubmitUpdate.commit();
    String otherUserIdentToFix = getAccountIdentToFix(otherUser.getAccount());
    String changeOwnerIdentToFix = getAccountIdentToFix(changeOwner.getAccount());
    RevCommit invalidUpdateCommit = writeUpdate(RefNames.changeMetaRef(c.getId()), getChangeUpdateBody(c, /*changeMessage=*/
    null, "Label: SUBM=+1", "Submission-id: 5271-1496917120975-10a10df9", "Submitted-with: NOT_READY", "Submitted-with: NEED: Code-Review: " + otherUserIdentToFix, "Submitted-with: OK: Code-Style", "Submitted-with: OK: Verified: " + changeOwnerIdentToFix, "Submitted-with: FORCED with error"), getAuthorIdent(changeOwner.getAccount()));
    ChangeUpdate postSubmitUpdate = newUpdate(c, changeOwner);
    postSubmitUpdate.setChangeMessage("Per-submit update");
    postSubmitUpdate.commit();
    Ref metaRefBeforeRewrite = repo.exactRef(RefNames.changeMetaRef(c.getId()));
    ImmutableList<RevCommit> commitsBeforeRewrite = logMetaRef(repo, metaRefBeforeRewrite);
    int invalidCommitIndex = commitsBeforeRewrite.indexOf(invalidUpdateCommit);
    ChangeNotes notesBeforeRewrite = newNotes(c);
    RunOptions options = new RunOptions();
    options.dryRun = false;
    BackfillResult result = rewriter.backfillProject(project, repo, options);
    assertThat(result.fixedRefDiff.keySet()).containsExactly(RefNames.changeMetaRef(c.getId()));
    ChangeNotes notesAfterRewrite = newNotes(c);
    ImmutableList<SubmitRecord> expectedRecords = ImmutableList.of(submitRecord("NOT_READY", null, submitLabel(CODE_REVIEW, "NEED", otherUserId), submitLabel("Code-Style", "OK", null), submitLabel(VERIFIED, "OK", changeOwner.getAccountId())), submitRecord("FORCED", " with error"));
    assertThat(notesBeforeRewrite.getSubmitRecords()).isEqualTo(expectedRecords);
    assertThat(notesAfterRewrite.getSubmitRecords()).isEqualTo(expectedRecords);
    Ref metaRefAfterRewrite = repo.exactRef(RefNames.changeMetaRef(c.getId()));
    assertThat(metaRefAfterRewrite.getObjectId()).isNotEqualTo(metaRefBeforeRewrite.getObjectId());
    ImmutableList<RevCommit> commitsAfterRewrite = logMetaRef(repo, metaRefAfterRewrite);
    assertValidCommits(commitsBeforeRewrite, commitsAfterRewrite, ImmutableList.of(invalidCommitIndex));
    assertFixedCommits(ImmutableList.of(invalidUpdateCommit.getId()), result, c.getId());
    List<String> commitHistoryDiff = commitHistoryDiff(result, c.getId());
    assertThat(commitHistoryDiff).containsExactly("@@ -10 +10 @@\n" + "-Submitted-with: NEED: Code-Review: Other Account <2@gerrit>\n" + "+Submitted-with: NEED: Code-Review: Gerrit User 2 <2@gerrit>\n" + "@@ -12 +12 @@\n" + "-Submitted-with: OK: Verified: Change Owner <1@gerrit>\n" + "+Submitted-with: OK: Verified: Gerrit User 1 <1@gerrit>\n");
    BackfillResult secondRunResult = rewriter.backfillProject(project, repo, options);
    assertThat(secondRunResult.fixedRefDiff.keySet()).isEmpty();
    assertThat(secondRunResult.refsFailedToFix).isEmpty();
}
Also used : BackfillResult(com.google.gerrit.server.notedb.CommitRewriter.BackfillResult) Change(com.google.gerrit.entities.Change) SubmitRecord(com.google.gerrit.entities.SubmitRecord) Ref(org.eclipse.jgit.lib.Ref) RunOptions(com.google.gerrit.server.notedb.CommitRewriter.RunOptions) RevCommit(org.eclipse.jgit.revwalk.RevCommit) Test(org.junit.Test)

Aggregations

Change (com.google.gerrit.entities.Change)30 BackfillResult (com.google.gerrit.server.notedb.CommitRewriter.BackfillResult)30 RunOptions (com.google.gerrit.server.notedb.CommitRewriter.RunOptions)30 Test (org.junit.Test)29 Ref (org.eclipse.jgit.lib.Ref)21 RevCommit (org.eclipse.jgit.revwalk.RevCommit)15 PersonIdent (org.eclipse.jgit.lib.PersonIdent)14 ObjectId (org.eclipse.jgit.lib.ObjectId)13 ImmutableMap (com.google.common.collect.ImmutableMap)12 Account (com.google.gerrit.entities.Account)12 Instant (java.time.Instant)12 ImmutableList (com.google.common.collect.ImmutableList)11 ImmutableList.toImmutableList (com.google.common.collect.ImmutableList.toImmutableList)11 AttentionSetUpdate (com.google.gerrit.entities.AttentionSetUpdate)11 SubmitRecord (com.google.gerrit.entities.SubmitRecord)11 IdentifiedUser (com.google.gerrit.server.IdentifiedUser)11 HashSet (java.util.HashSet)11 Map (java.util.Map)11 Truth.assertThat (com.google.common.truth.Truth.assertThat)10 Operation (com.google.gerrit.entities.AttentionSetUpdate.Operation)10