Search in sources :

Example 71 with LabelType

use of com.google.gerrit.entities.LabelType in project gerrit by GerritCodeReview.

the class IgnoreSelfApprovalRuleTest method filtersByLabel.

@Test
public void filtersByLabel() {
    LabelType codeReview = makeLabel(LabelId.CODE_REVIEW);
    PatchSetApproval approvalVerified = makeApproval(VERIFIED.getLabelId(), USER1, 2);
    PatchSetApproval approvalCr = makeApproval(codeReview.getLabelId(), USER1, 2);
    Collection<PatchSetApproval> filteredApprovals = IgnoreSelfApprovalRule.filterApprovalsByLabel(ImmutableList.of(approvalVerified, approvalCr), VERIFIED);
    assertThat(filteredApprovals).containsExactly(approvalVerified);
}
Also used : LabelType(com.google.gerrit.entities.LabelType) PatchSetApproval(com.google.gerrit.entities.PatchSetApproval) Test(org.junit.Test)

Aggregations

LabelType (com.google.gerrit.entities.LabelType)71 Test (org.junit.Test)26 PatchSetApproval (com.google.gerrit.entities.PatchSetApproval)20 AbstractDaemonTest (com.google.gerrit.acceptance.AbstractDaemonTest)16 PushOneCommit (com.google.gerrit.acceptance.PushOneCommit)14 ChangeInfo (com.google.gerrit.extensions.common.ChangeInfo)13 Map (java.util.Map)12 LabelTypes (com.google.gerrit.entities.LabelTypes)10 ReviewInput (com.google.gerrit.extensions.api.changes.ReviewInput)9 Account (com.google.gerrit.entities.Account)8 LabelValue (com.google.gerrit.entities.LabelValue)8 AuthException (com.google.gerrit.extensions.restapi.AuthException)8 BadRequestException (com.google.gerrit.extensions.restapi.BadRequestException)8 HashMap (java.util.HashMap)8 ProjectConfig (com.google.gerrit.server.project.ProjectConfig)7 ArrayList (java.util.ArrayList)7 LabelPermission (com.google.gerrit.server.permissions.LabelPermission)6 ProjectState (com.google.gerrit.server.project.ProjectState)6 Change (com.google.gerrit.entities.Change)5 SubmitRecord (com.google.gerrit.entities.SubmitRecord)5