Search in sources :

Example 1 with REVIEWER

use of com.google.gerrit.extensions.client.ReviewerState.REVIEWER in project gerrit by GerritCodeReview.

the class ChangeIT method pendingReviewers.

@Test
public void pendingReviewers() throws Exception {
    ConfigInput conf = new ConfigInput();
    conf.enableReviewerByEmail = InheritableBoolean.TRUE;
    gApi.projects().name(project.get()).config(conf);
    PushOneCommit.Result r = createWorkInProgressChange();
    String changeId = r.getChangeId();
    assertThat(gApi.changes().id(changeId).get().pendingReviewers).isEmpty();
    // Add some pending reviewers.
    String email1 = name("user1") + "@example.com";
    String email2 = name("user2") + "@example.com";
    String email3 = name("user3") + "@example.com";
    String email4 = name("user4") + "@example.com";
    accountOperations.newAccount().username(name("user1")).preferredEmail(email1).fullname("User1").create();
    accountOperations.newAccount().username(name("user2")).preferredEmail(email2).fullname("User2").create();
    accountOperations.newAccount().username(name("user3")).preferredEmail(email3).fullname("User3").create();
    accountOperations.newAccount().username(name("user4")).preferredEmail(email4).fullname("User4").create();
    ReviewInput in = ReviewInput.noScore().reviewer(email1).reviewer(email2).reviewer(email3, CC, false).reviewer(email4, CC, false).reviewer("byemail1@example.com").reviewer("byemail2@example.com").reviewer("byemail3@example.com", CC, false).reviewer("byemail4@example.com", CC, false);
    ReviewResult result = gApi.changes().id(changeId).current().review(in);
    assertThat(result.reviewers).isNotEmpty();
    ChangeInfo info = gApi.changes().id(changeId).get();
    Function<Collection<AccountInfo>, Collection<String>> toEmails = ais -> ais.stream().map(ai -> ai.email).collect(toSet());
    assertThat(toEmails.apply(info.pendingReviewers.get(REVIEWER))).containsExactly(email1, email2, "byemail1@example.com", "byemail2@example.com");
    assertThat(toEmails.apply(info.pendingReviewers.get(CC))).containsExactly(email3, email4, "byemail3@example.com", "byemail4@example.com");
    assertThat(info.pendingReviewers.get(REMOVED)).isNull();
    // Stage some pending reviewer removals.
    gApi.changes().id(changeId).reviewer(email1).remove();
    gApi.changes().id(changeId).reviewer(email3).remove();
    gApi.changes().id(changeId).reviewer("byemail1@example.com").remove();
    gApi.changes().id(changeId).reviewer("byemail3@example.com").remove();
    info = gApi.changes().id(changeId).get();
    assertThat(toEmails.apply(info.pendingReviewers.get(REVIEWER))).containsExactly(email2, "byemail2@example.com");
    assertThat(toEmails.apply(info.pendingReviewers.get(CC))).containsExactly(email4, "byemail4@example.com");
    assertThat(toEmails.apply(info.pendingReviewers.get(REMOVED))).containsExactly(email1, email3, "byemail1@example.com", "byemail3@example.com");
    // "Undo" a removal.
    in = ReviewInput.noScore().reviewer(email1);
    gApi.changes().id(changeId).current().review(in);
    info = gApi.changes().id(changeId).get();
    assertThat(toEmails.apply(info.pendingReviewers.get(REVIEWER))).containsExactly(email1, email2, "byemail2@example.com");
    assertThat(toEmails.apply(info.pendingReviewers.get(CC))).containsExactly(email4, "byemail4@example.com");
    assertThat(toEmails.apply(info.pendingReviewers.get(REMOVED))).containsExactly(email3, "byemail1@example.com", "byemail3@example.com");
    // "Commit" by moving out of WIP.
    gApi.changes().id(changeId).setReadyForReview();
    info = gApi.changes().id(changeId).get();
    assertThat(info.pendingReviewers).isEmpty();
    assertThat(toEmails.apply(info.reviewers.get(REVIEWER))).containsExactly(email1, email2, "byemail2@example.com");
    assertThat(toEmails.apply(info.reviewers.get(CC))).containsExactly(email4, "byemail4@example.com");
    assertThat(info.reviewers.get(REMOVED)).isNull();
}
Also used : NotifyInfo(com.google.gerrit.extensions.api.changes.NotifyInfo) MERGED(com.google.gerrit.extensions.client.ChangeStatus.MERGED) CHANGE_OWNER(com.google.gerrit.server.group.SystemGroupBackend.CHANGE_OWNER) CommentInfo(com.google.gerrit.extensions.common.CommentInfo) SystemGroupBackend(com.google.gerrit.server.group.SystemGroupBackend) BadRequestException(com.google.gerrit.extensions.restapi.BadRequestException) PushOneCommit(com.google.gerrit.acceptance.PushOneCommit) RevWalk(org.eclipse.jgit.revwalk.RevWalk) TestProjectUpdate.blockLabel(com.google.gerrit.acceptance.testsuite.project.TestProjectUpdate.blockLabel) PROJECT_OWNERS(com.google.gerrit.server.group.SystemGroupBackend.PROJECT_OWNERS) Map(java.util.Map) DraftHandling(com.google.gerrit.extensions.api.changes.ReviewInput.DraftHandling) Side(com.google.gerrit.extensions.client.Side) ThrowableSubject(com.google.common.truth.ThrowableSubject) EnumSet(java.util.EnumSet) FILE_NAME(com.google.gerrit.acceptance.PushOneCommit.FILE_NAME) DeleteVoteInput(com.google.gerrit.extensions.api.changes.DeleteVoteInput) Result(org.eclipse.jgit.lib.RefUpdate.Result) Constants(org.eclipse.jgit.lib.Constants) Collectors.joining(java.util.stream.Collectors.joining) NoHttpd(com.google.gerrit.acceptance.NoHttpd) RequestScopeOperations(com.google.gerrit.acceptance.testsuite.request.RequestScopeOperations) PersonIdent(org.eclipse.jgit.lib.PersonIdent) UseClockStep(com.google.gerrit.acceptance.UseClockStep) Stream(java.util.stream.Stream) DeleteReviewerInput(com.google.gerrit.extensions.api.changes.DeleteReviewerInput) MESSAGES(com.google.gerrit.extensions.client.ListChangesOption.MESSAGES) PushResult(org.eclipse.jgit.transport.PushResult) ProjectInput(com.google.gerrit.extensions.api.projects.ProjectInput) DiffSummary(com.google.gerrit.server.patch.DiffSummary) GerritJUnit.assertThrows(com.google.gerrit.testing.GerritJUnit.assertThrows) Exports(com.google.gerrit.extensions.annotations.Exports) IndexPreloadingUtil(com.google.gerrit.httpd.raw.IndexPreloadingUtil) RevCommit(org.eclipse.jgit.revwalk.RevCommit) ByteArrayOutputStream(java.io.ByteArrayOutputStream) UnprocessableEntityException(com.google.gerrit.extensions.restapi.UnprocessableEntityException) RawInputUtil(com.google.gerrit.common.RawInputUtil) AccountOperations(com.google.gerrit.acceptance.testsuite.account.AccountOperations) ReviewerInput(com.google.gerrit.extensions.api.changes.ReviewerInput) Lists(com.google.common.collect.Lists) LabelFunction(com.google.gerrit.entities.LabelFunction) ExtensionRegistry(com.google.gerrit.acceptance.ExtensionRegistry) TestRepository(org.eclipse.jgit.junit.TestRepository) CURRENT_ACTIONS(com.google.gerrit.extensions.client.ListChangesOption.CURRENT_ACTIONS) ObjectIds.abbreviateName(com.google.gerrit.git.ObjectIds.abbreviateName) IOException(java.io.IOException) Test(org.junit.Test) AccountTemplateUtil(com.google.gerrit.server.util.AccountTemplateUtil) Project(com.google.gerrit.entities.Project) TimeUtil(com.google.gerrit.server.util.time.TimeUtil) Named(com.google.inject.name.Named) FooterConstants(com.google.gerrit.common.FooterConstants) GitUtil.assertPushOk(com.google.gerrit.acceptance.GitUtil.assertPushOk) AbstractModule(com.google.inject.AbstractModule) RefNames.changeMetaRef(com.google.gerrit.entities.RefNames.changeMetaRef) Inject(com.google.inject.Inject) REVIEWER(com.google.gerrit.extensions.client.ReviewerState.REVIEWER) FILE_CONTENT(com.google.gerrit.acceptance.PushOneCommit.FILE_CONTENT) InheritableBoolean(com.google.gerrit.extensions.client.InheritableBoolean) AccountInfo(com.google.gerrit.extensions.common.AccountInfo) LabelType(com.google.gerrit.entities.LabelType) REVIEWED(com.google.gerrit.extensions.client.ListChangesOption.REVIEWED) AuthException(com.google.gerrit.extensions.restapi.AuthException) ChangeInput(com.google.gerrit.extensions.common.ChangeInput) CHECK(com.google.gerrit.extensions.client.ListChangesOption.CHECK) IntraLineDiffKey(com.google.gerrit.server.patch.IntraLineDiffKey) ImmutableSet(com.google.common.collect.ImmutableSet) SubmitType(com.google.gerrit.extensions.client.SubmitType) Timestamp(java.sql.Timestamp) Collection(java.util.Collection) Instant(java.time.Instant) Collectors(java.util.stream.Collectors) Objects(java.util.Objects) ChangeData(com.google.gerrit.server.query.change.ChangeData) RebaseInput(com.google.gerrit.extensions.api.changes.RebaseInput) TestProjectUpdate.block(com.google.gerrit.acceptance.testsuite.project.TestProjectUpdate.block) LabelId(com.google.gerrit.entities.LabelId) DraftInput(com.google.gerrit.extensions.api.changes.DraftInput) Function(java.util.function.Function) MessageFormat(java.text.MessageFormat) BinaryResult(com.google.gerrit.extensions.restapi.BinaryResult) ImmutableList(com.google.common.collect.ImmutableList) Change(com.google.gerrit.entities.Change) Truth8.assertThat(com.google.common.truth.Truth8.assertThat) ChangeContext(com.google.gerrit.server.update.ChangeContext) TestProjectUpdate.allowCapability(com.google.gerrit.acceptance.testsuite.project.TestProjectUpdate.allowCapability) UTF_8(java.nio.charset.StandardCharsets.UTF_8) CHANGE_ACTIONS(com.google.gerrit.extensions.client.ListChangesOption.CHANGE_ACTIONS) Truth.assertThat(com.google.common.truth.Truth.assertThat) Collectors.toList(java.util.stream.Collectors.toList) Message(com.google.gerrit.testing.FakeEmailSender.Message) GerritConfig(com.google.gerrit.acceptance.config.GerritConfig) COMMIT_FOOTERS(com.google.gerrit.extensions.client.ListChangesOption.COMMIT_FOOTERS) Cache(com.google.common.cache.Cache) StarredChangesUtil(com.google.gerrit.server.StarredChangesUtil) TestProjectUpdate.labelPermissionKey(com.google.gerrit.acceptance.testsuite.project.TestProjectUpdate.labelPermissionKey) ResourceNotFoundException(com.google.gerrit.extensions.restapi.ResourceNotFoundException) Arrays(java.util.Arrays) LabelInfo(com.google.gerrit.extensions.common.LabelInfo) GlobalCapability(com.google.gerrit.common.data.GlobalCapability) TrackingIdInfo(com.google.gerrit.extensions.common.TrackingIdInfo) TestAccount(com.google.gerrit.acceptance.TestAccount) REGISTERED_USERS(com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS) CommitReceivedEvent(com.google.gerrit.server.events.CommitReceivedEvent) ReviewResult(com.google.gerrit.extensions.api.changes.ReviewResult) DiffSummaryKey(com.google.gerrit.server.patch.DiffSummaryKey) Registration(com.google.gerrit.acceptance.ExtensionRegistry.Registration) ConfigInput(com.google.gerrit.extensions.api.projects.ConfigInput) GroupOperations(com.google.gerrit.acceptance.testsuite.group.GroupOperations) TestProjectUpdate.allow(com.google.gerrit.acceptance.testsuite.project.TestProjectUpdate.allow) DeleteDraftCommentsInput(com.google.gerrit.extensions.api.accounts.DeleteDraftCommentsInput) ApprovalInfo(com.google.gerrit.extensions.common.ApprovalInfo) ChangeMessages(com.google.gerrit.server.change.ChangeMessages) ChangeOperatorFactory(com.google.gerrit.server.query.change.ChangeQueryBuilder.ChangeOperatorFactory) Set(java.util.Set) RefUpdate(org.eclipse.jgit.lib.RefUpdate) TestLabels.label(com.google.gerrit.server.project.testing.TestLabels.label) TestLabels.value(com.google.gerrit.server.project.testing.TestLabels.value) BranchNameKey(com.google.gerrit.entities.BranchNameKey) NotifyHandling(com.google.gerrit.extensions.api.changes.NotifyHandling) ImmutableMap.toImmutableMap(com.google.common.collect.ImmutableMap.toImmutableMap) AbstractDaemonTest(com.google.gerrit.acceptance.AbstractDaemonTest) CacheStats(com.google.common.cache.CacheStats) ChangeMessagesUtil(com.google.gerrit.server.ChangeMessagesUtil) Iterables(com.google.common.collect.Iterables) BranchInput(com.google.gerrit.extensions.api.projects.BranchInput) ReviewerResult(com.google.gerrit.extensions.api.changes.ReviewerResult) TestChangeETagComputation(com.google.gerrit.server.change.testing.TestChangeETagComputation) TestLabels(com.google.gerrit.server.project.testing.TestLabels) ArrayList(java.util.ArrayList) CURRENT_COMMIT(com.google.gerrit.extensions.client.ListChangesOption.CURRENT_COMMIT) ChangeMessageModifier(com.google.gerrit.server.git.ChangeMessageModifier) PatchSet(com.google.gerrit.entities.PatchSet) RestApiException(com.google.gerrit.extensions.restapi.RestApiException) GitUtil(com.google.gerrit.acceptance.GitUtil) Address(com.google.gerrit.entities.Address) WorkInProgressStateChangedListener(com.google.gerrit.extensions.events.WorkInProgressStateChangedListener) AccountGroup(com.google.gerrit.entities.AccountGroup) CommitValidationMessage(com.google.gerrit.server.git.validators.CommitValidationMessage) CacheStatsSubject.assertThat(com.google.gerrit.truth.CacheStatsSubject.assertThat) StorageException(com.google.gerrit.exceptions.StorageException) ChangeIndexedCounter(com.google.gerrit.acceptance.ChangeIndexedCounter) ANONYMOUS_USERS(com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS) CommitValidationListener(com.google.gerrit.server.git.validators.CommitValidationListener) ReviewInput(com.google.gerrit.extensions.api.changes.ReviewInput) ChangeKind(com.google.gerrit.extensions.client.ChangeKind) ChangeIndexCollection(com.google.gerrit.server.index.change.ChangeIndexCollection) Repository(org.eclipse.jgit.lib.Repository) REMOVED(com.google.gerrit.extensions.client.ReviewerState.REMOVED) ALL_REVISIONS(com.google.gerrit.extensions.client.ListChangesOption.ALL_REVISIONS) RevisionInfo(com.google.gerrit.extensions.common.RevisionInfo) GroupApi(com.google.gerrit.extensions.api.groups.GroupApi) PUSH_CERTIFICATES(com.google.gerrit.extensions.client.ListChangesOption.PUSH_CERTIFICATES) IntraLineDiff(com.google.gerrit.server.patch.IntraLineDiff) PostFilterPredicate(com.google.gerrit.index.query.PostFilterPredicate) DraftApi(com.google.gerrit.extensions.api.changes.DraftApi) BatchUpdate(com.google.gerrit.server.update.BatchUpdate) DEFAULT_LABEL(com.google.gerrit.server.StarredChangesUtil.DEFAULT_LABEL) RefNames(com.google.gerrit.entities.RefNames) Collectors.toSet(java.util.stream.Collectors.toSet) PostReview(com.google.gerrit.server.restapi.change.PostReview) ReviewerInfo(com.google.gerrit.extensions.api.changes.ReviewerInfo) Truth.assertWithMessage(com.google.common.truth.Truth.assertWithMessage) ImmutableMap(com.google.common.collect.ImmutableMap) VerifyNoPiiInChangeNotes(com.google.gerrit.acceptance.VerifyNoPiiInChangeNotes) RevisionApi(com.google.gerrit.extensions.api.changes.RevisionApi) DETAILED_LABELS(com.google.gerrit.extensions.client.ListChangesOption.DETAILED_LABELS) Account(com.google.gerrit.entities.Account) CommitInfo(com.google.gerrit.extensions.common.CommitInfo) MethodNotAllowedException(com.google.gerrit.extensions.restapi.MethodNotAllowedException) List(java.util.List) Optional(java.util.Optional) BatchUpdateOp(com.google.gerrit.server.update.BatchUpdateOp) GitPerson(com.google.gerrit.extensions.common.GitPerson) TestProjectUpdate.allowLabel(com.google.gerrit.acceptance.testsuite.project.TestProjectUpdate.allowLabel) IndexConfig(com.google.gerrit.index.IndexConfig) CC(com.google.gerrit.extensions.client.ReviewerState.CC) InMemoryRepository(org.eclipse.jgit.internal.storage.dfs.InMemoryRepository) RelatedChangeAndCommitInfo(com.google.gerrit.extensions.api.changes.RelatedChangeAndCommitInfo) ReviewerState(com.google.gerrit.extensions.client.ReviewerState) HashMap(java.util.HashMap) TestProjectInput(com.google.gerrit.acceptance.TestProjectInput) UseTimezone(com.google.gerrit.acceptance.UseTimezone) ChangeResource(com.google.gerrit.server.change.ChangeResource) SUBJECT(com.google.gerrit.acceptance.PushOneCommit.SUBJECT) Range(com.google.gerrit.extensions.client.Comment.Range) CURRENT_REVISION(com.google.gerrit.extensions.client.ListChangesOption.CURRENT_REVISION) ChangeInfo(com.google.gerrit.extensions.common.ChangeInfo) ListChangesOption(com.google.gerrit.extensions.client.ListChangesOption) GitUtil.pushHead(com.google.gerrit.acceptance.GitUtil.pushHead) TRACKING_IDS(com.google.gerrit.extensions.client.ListChangesOption.TRACKING_IDS) CommitValidationException(com.google.gerrit.server.git.validators.CommitValidationException) Iterator(java.util.Iterator) Permission(com.google.gerrit.entities.Permission) ChangeMessageInfo(com.google.gerrit.extensions.common.ChangeMessageInfo) IndexedChangeQuery(com.google.gerrit.server.index.change.IndexedChangeQuery) TestProjectUpdate.permissionKey(com.google.gerrit.acceptance.testsuite.project.TestProjectUpdate.permissionKey) ProjectOperations(com.google.gerrit.acceptance.testsuite.project.ProjectOperations) RecipientType(com.google.gerrit.extensions.api.changes.RecipientType) ResourceConflictException(com.google.gerrit.extensions.restapi.ResourceConflictException) AttentionSetInput(com.google.gerrit.extensions.api.changes.AttentionSetInput) ChangeIndex(com.google.gerrit.server.index.change.ChangeIndex) CacheStatsSubject.cloneStats(com.google.gerrit.truth.CacheStatsSubject.cloneStats) ChangeStatus(com.google.gerrit.extensions.client.ChangeStatus) ConfigInput(com.google.gerrit.extensions.api.projects.ConfigInput) ChangeInfo(com.google.gerrit.extensions.common.ChangeInfo) ReviewResult(com.google.gerrit.extensions.api.changes.ReviewResult) Collection(java.util.Collection) ChangeIndexCollection(com.google.gerrit.server.index.change.ChangeIndexCollection) ReviewInput(com.google.gerrit.extensions.api.changes.ReviewInput) PushOneCommit(com.google.gerrit.acceptance.PushOneCommit) Test(org.junit.Test) AbstractDaemonTest(com.google.gerrit.acceptance.AbstractDaemonTest)

Example 2 with REVIEWER

use of com.google.gerrit.extensions.client.ReviewerState.REVIEWER in project gerrit by GerritCodeReview.

the class ChangeIT method implicitlyAddReviewerOnVotingReview.

@Test
public void implicitlyAddReviewerOnVotingReview() throws Exception {
    PushOneCommit.Result r = createChange();
    requestScopeOperations.setApiUser(user.id());
    gApi.changes().id(r.getChangeId()).revision(r.getCommit().name()).review(ReviewInput.recommend().message("LGTM"));
    ChangeInfo c = gApi.changes().id(r.getChangeId()).get();
    assertThat(c.reviewers.get(REVIEWER).stream().map(ai -> ai._accountId).collect(toList())).containsExactly(user.id().get());
    // Further test: remove the vote, then comment again. The user should be
    // implicitly re-added to the ReviewerSet, as a CC.
    requestScopeOperations.setApiUser(admin.id());
    gApi.changes().id(r.getChangeId()).reviewer(user.id().toString()).remove();
    c = gApi.changes().id(r.getChangeId()).get();
    assertThat(c.reviewers.values()).isEmpty();
    requestScopeOperations.setApiUser(user.id());
    gApi.changes().id(r.getChangeId()).revision(r.getCommit().name()).review(new ReviewInput().message("hi"));
    c = gApi.changes().id(r.getChangeId()).get();
    assertThat(c.reviewers.get(CC).stream().map(ai -> ai._accountId).collect(toList())).containsExactly(user.id().get());
}
Also used : NotifyInfo(com.google.gerrit.extensions.api.changes.NotifyInfo) MERGED(com.google.gerrit.extensions.client.ChangeStatus.MERGED) CHANGE_OWNER(com.google.gerrit.server.group.SystemGroupBackend.CHANGE_OWNER) CommentInfo(com.google.gerrit.extensions.common.CommentInfo) SystemGroupBackend(com.google.gerrit.server.group.SystemGroupBackend) BadRequestException(com.google.gerrit.extensions.restapi.BadRequestException) PushOneCommit(com.google.gerrit.acceptance.PushOneCommit) RevWalk(org.eclipse.jgit.revwalk.RevWalk) TestProjectUpdate.blockLabel(com.google.gerrit.acceptance.testsuite.project.TestProjectUpdate.blockLabel) PROJECT_OWNERS(com.google.gerrit.server.group.SystemGroupBackend.PROJECT_OWNERS) Map(java.util.Map) DraftHandling(com.google.gerrit.extensions.api.changes.ReviewInput.DraftHandling) Side(com.google.gerrit.extensions.client.Side) ThrowableSubject(com.google.common.truth.ThrowableSubject) EnumSet(java.util.EnumSet) FILE_NAME(com.google.gerrit.acceptance.PushOneCommit.FILE_NAME) DeleteVoteInput(com.google.gerrit.extensions.api.changes.DeleteVoteInput) Result(org.eclipse.jgit.lib.RefUpdate.Result) Constants(org.eclipse.jgit.lib.Constants) Collectors.joining(java.util.stream.Collectors.joining) NoHttpd(com.google.gerrit.acceptance.NoHttpd) RequestScopeOperations(com.google.gerrit.acceptance.testsuite.request.RequestScopeOperations) PersonIdent(org.eclipse.jgit.lib.PersonIdent) UseClockStep(com.google.gerrit.acceptance.UseClockStep) Stream(java.util.stream.Stream) DeleteReviewerInput(com.google.gerrit.extensions.api.changes.DeleteReviewerInput) MESSAGES(com.google.gerrit.extensions.client.ListChangesOption.MESSAGES) PushResult(org.eclipse.jgit.transport.PushResult) ProjectInput(com.google.gerrit.extensions.api.projects.ProjectInput) DiffSummary(com.google.gerrit.server.patch.DiffSummary) GerritJUnit.assertThrows(com.google.gerrit.testing.GerritJUnit.assertThrows) Exports(com.google.gerrit.extensions.annotations.Exports) IndexPreloadingUtil(com.google.gerrit.httpd.raw.IndexPreloadingUtil) RevCommit(org.eclipse.jgit.revwalk.RevCommit) ByteArrayOutputStream(java.io.ByteArrayOutputStream) UnprocessableEntityException(com.google.gerrit.extensions.restapi.UnprocessableEntityException) RawInputUtil(com.google.gerrit.common.RawInputUtil) AccountOperations(com.google.gerrit.acceptance.testsuite.account.AccountOperations) ReviewerInput(com.google.gerrit.extensions.api.changes.ReviewerInput) Lists(com.google.common.collect.Lists) LabelFunction(com.google.gerrit.entities.LabelFunction) ExtensionRegistry(com.google.gerrit.acceptance.ExtensionRegistry) TestRepository(org.eclipse.jgit.junit.TestRepository) CURRENT_ACTIONS(com.google.gerrit.extensions.client.ListChangesOption.CURRENT_ACTIONS) ObjectIds.abbreviateName(com.google.gerrit.git.ObjectIds.abbreviateName) IOException(java.io.IOException) Test(org.junit.Test) AccountTemplateUtil(com.google.gerrit.server.util.AccountTemplateUtil) Project(com.google.gerrit.entities.Project) TimeUtil(com.google.gerrit.server.util.time.TimeUtil) Named(com.google.inject.name.Named) FooterConstants(com.google.gerrit.common.FooterConstants) GitUtil.assertPushOk(com.google.gerrit.acceptance.GitUtil.assertPushOk) AbstractModule(com.google.inject.AbstractModule) RefNames.changeMetaRef(com.google.gerrit.entities.RefNames.changeMetaRef) Inject(com.google.inject.Inject) REVIEWER(com.google.gerrit.extensions.client.ReviewerState.REVIEWER) FILE_CONTENT(com.google.gerrit.acceptance.PushOneCommit.FILE_CONTENT) InheritableBoolean(com.google.gerrit.extensions.client.InheritableBoolean) AccountInfo(com.google.gerrit.extensions.common.AccountInfo) LabelType(com.google.gerrit.entities.LabelType) REVIEWED(com.google.gerrit.extensions.client.ListChangesOption.REVIEWED) AuthException(com.google.gerrit.extensions.restapi.AuthException) ChangeInput(com.google.gerrit.extensions.common.ChangeInput) CHECK(com.google.gerrit.extensions.client.ListChangesOption.CHECK) IntraLineDiffKey(com.google.gerrit.server.patch.IntraLineDiffKey) ImmutableSet(com.google.common.collect.ImmutableSet) SubmitType(com.google.gerrit.extensions.client.SubmitType) Timestamp(java.sql.Timestamp) Collection(java.util.Collection) Instant(java.time.Instant) Collectors(java.util.stream.Collectors) Objects(java.util.Objects) ChangeData(com.google.gerrit.server.query.change.ChangeData) RebaseInput(com.google.gerrit.extensions.api.changes.RebaseInput) TestProjectUpdate.block(com.google.gerrit.acceptance.testsuite.project.TestProjectUpdate.block) LabelId(com.google.gerrit.entities.LabelId) DraftInput(com.google.gerrit.extensions.api.changes.DraftInput) Function(java.util.function.Function) MessageFormat(java.text.MessageFormat) BinaryResult(com.google.gerrit.extensions.restapi.BinaryResult) ImmutableList(com.google.common.collect.ImmutableList) Change(com.google.gerrit.entities.Change) Truth8.assertThat(com.google.common.truth.Truth8.assertThat) ChangeContext(com.google.gerrit.server.update.ChangeContext) TestProjectUpdate.allowCapability(com.google.gerrit.acceptance.testsuite.project.TestProjectUpdate.allowCapability) UTF_8(java.nio.charset.StandardCharsets.UTF_8) CHANGE_ACTIONS(com.google.gerrit.extensions.client.ListChangesOption.CHANGE_ACTIONS) Truth.assertThat(com.google.common.truth.Truth.assertThat) Collectors.toList(java.util.stream.Collectors.toList) Message(com.google.gerrit.testing.FakeEmailSender.Message) GerritConfig(com.google.gerrit.acceptance.config.GerritConfig) COMMIT_FOOTERS(com.google.gerrit.extensions.client.ListChangesOption.COMMIT_FOOTERS) Cache(com.google.common.cache.Cache) StarredChangesUtil(com.google.gerrit.server.StarredChangesUtil) TestProjectUpdate.labelPermissionKey(com.google.gerrit.acceptance.testsuite.project.TestProjectUpdate.labelPermissionKey) ResourceNotFoundException(com.google.gerrit.extensions.restapi.ResourceNotFoundException) Arrays(java.util.Arrays) LabelInfo(com.google.gerrit.extensions.common.LabelInfo) GlobalCapability(com.google.gerrit.common.data.GlobalCapability) TrackingIdInfo(com.google.gerrit.extensions.common.TrackingIdInfo) TestAccount(com.google.gerrit.acceptance.TestAccount) REGISTERED_USERS(com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS) CommitReceivedEvent(com.google.gerrit.server.events.CommitReceivedEvent) ReviewResult(com.google.gerrit.extensions.api.changes.ReviewResult) DiffSummaryKey(com.google.gerrit.server.patch.DiffSummaryKey) Registration(com.google.gerrit.acceptance.ExtensionRegistry.Registration) ConfigInput(com.google.gerrit.extensions.api.projects.ConfigInput) GroupOperations(com.google.gerrit.acceptance.testsuite.group.GroupOperations) TestProjectUpdate.allow(com.google.gerrit.acceptance.testsuite.project.TestProjectUpdate.allow) DeleteDraftCommentsInput(com.google.gerrit.extensions.api.accounts.DeleteDraftCommentsInput) ApprovalInfo(com.google.gerrit.extensions.common.ApprovalInfo) ChangeMessages(com.google.gerrit.server.change.ChangeMessages) ChangeOperatorFactory(com.google.gerrit.server.query.change.ChangeQueryBuilder.ChangeOperatorFactory) Set(java.util.Set) RefUpdate(org.eclipse.jgit.lib.RefUpdate) TestLabels.label(com.google.gerrit.server.project.testing.TestLabels.label) TestLabels.value(com.google.gerrit.server.project.testing.TestLabels.value) BranchNameKey(com.google.gerrit.entities.BranchNameKey) NotifyHandling(com.google.gerrit.extensions.api.changes.NotifyHandling) ImmutableMap.toImmutableMap(com.google.common.collect.ImmutableMap.toImmutableMap) AbstractDaemonTest(com.google.gerrit.acceptance.AbstractDaemonTest) CacheStats(com.google.common.cache.CacheStats) ChangeMessagesUtil(com.google.gerrit.server.ChangeMessagesUtil) Iterables(com.google.common.collect.Iterables) BranchInput(com.google.gerrit.extensions.api.projects.BranchInput) ReviewerResult(com.google.gerrit.extensions.api.changes.ReviewerResult) TestChangeETagComputation(com.google.gerrit.server.change.testing.TestChangeETagComputation) TestLabels(com.google.gerrit.server.project.testing.TestLabels) ArrayList(java.util.ArrayList) CURRENT_COMMIT(com.google.gerrit.extensions.client.ListChangesOption.CURRENT_COMMIT) ChangeMessageModifier(com.google.gerrit.server.git.ChangeMessageModifier) PatchSet(com.google.gerrit.entities.PatchSet) RestApiException(com.google.gerrit.extensions.restapi.RestApiException) GitUtil(com.google.gerrit.acceptance.GitUtil) Address(com.google.gerrit.entities.Address) WorkInProgressStateChangedListener(com.google.gerrit.extensions.events.WorkInProgressStateChangedListener) AccountGroup(com.google.gerrit.entities.AccountGroup) CommitValidationMessage(com.google.gerrit.server.git.validators.CommitValidationMessage) CacheStatsSubject.assertThat(com.google.gerrit.truth.CacheStatsSubject.assertThat) StorageException(com.google.gerrit.exceptions.StorageException) ChangeIndexedCounter(com.google.gerrit.acceptance.ChangeIndexedCounter) ANONYMOUS_USERS(com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS) CommitValidationListener(com.google.gerrit.server.git.validators.CommitValidationListener) ReviewInput(com.google.gerrit.extensions.api.changes.ReviewInput) ChangeKind(com.google.gerrit.extensions.client.ChangeKind) ChangeIndexCollection(com.google.gerrit.server.index.change.ChangeIndexCollection) Repository(org.eclipse.jgit.lib.Repository) REMOVED(com.google.gerrit.extensions.client.ReviewerState.REMOVED) ALL_REVISIONS(com.google.gerrit.extensions.client.ListChangesOption.ALL_REVISIONS) RevisionInfo(com.google.gerrit.extensions.common.RevisionInfo) GroupApi(com.google.gerrit.extensions.api.groups.GroupApi) PUSH_CERTIFICATES(com.google.gerrit.extensions.client.ListChangesOption.PUSH_CERTIFICATES) IntraLineDiff(com.google.gerrit.server.patch.IntraLineDiff) PostFilterPredicate(com.google.gerrit.index.query.PostFilterPredicate) DraftApi(com.google.gerrit.extensions.api.changes.DraftApi) BatchUpdate(com.google.gerrit.server.update.BatchUpdate) DEFAULT_LABEL(com.google.gerrit.server.StarredChangesUtil.DEFAULT_LABEL) RefNames(com.google.gerrit.entities.RefNames) Collectors.toSet(java.util.stream.Collectors.toSet) PostReview(com.google.gerrit.server.restapi.change.PostReview) ReviewerInfo(com.google.gerrit.extensions.api.changes.ReviewerInfo) Truth.assertWithMessage(com.google.common.truth.Truth.assertWithMessage) ImmutableMap(com.google.common.collect.ImmutableMap) VerifyNoPiiInChangeNotes(com.google.gerrit.acceptance.VerifyNoPiiInChangeNotes) RevisionApi(com.google.gerrit.extensions.api.changes.RevisionApi) DETAILED_LABELS(com.google.gerrit.extensions.client.ListChangesOption.DETAILED_LABELS) Account(com.google.gerrit.entities.Account) CommitInfo(com.google.gerrit.extensions.common.CommitInfo) MethodNotAllowedException(com.google.gerrit.extensions.restapi.MethodNotAllowedException) List(java.util.List) Optional(java.util.Optional) BatchUpdateOp(com.google.gerrit.server.update.BatchUpdateOp) GitPerson(com.google.gerrit.extensions.common.GitPerson) TestProjectUpdate.allowLabel(com.google.gerrit.acceptance.testsuite.project.TestProjectUpdate.allowLabel) IndexConfig(com.google.gerrit.index.IndexConfig) CC(com.google.gerrit.extensions.client.ReviewerState.CC) InMemoryRepository(org.eclipse.jgit.internal.storage.dfs.InMemoryRepository) RelatedChangeAndCommitInfo(com.google.gerrit.extensions.api.changes.RelatedChangeAndCommitInfo) ReviewerState(com.google.gerrit.extensions.client.ReviewerState) HashMap(java.util.HashMap) TestProjectInput(com.google.gerrit.acceptance.TestProjectInput) UseTimezone(com.google.gerrit.acceptance.UseTimezone) ChangeResource(com.google.gerrit.server.change.ChangeResource) SUBJECT(com.google.gerrit.acceptance.PushOneCommit.SUBJECT) Range(com.google.gerrit.extensions.client.Comment.Range) CURRENT_REVISION(com.google.gerrit.extensions.client.ListChangesOption.CURRENT_REVISION) ChangeInfo(com.google.gerrit.extensions.common.ChangeInfo) ListChangesOption(com.google.gerrit.extensions.client.ListChangesOption) GitUtil.pushHead(com.google.gerrit.acceptance.GitUtil.pushHead) TRACKING_IDS(com.google.gerrit.extensions.client.ListChangesOption.TRACKING_IDS) CommitValidationException(com.google.gerrit.server.git.validators.CommitValidationException) Iterator(java.util.Iterator) Permission(com.google.gerrit.entities.Permission) ChangeMessageInfo(com.google.gerrit.extensions.common.ChangeMessageInfo) IndexedChangeQuery(com.google.gerrit.server.index.change.IndexedChangeQuery) TestProjectUpdate.permissionKey(com.google.gerrit.acceptance.testsuite.project.TestProjectUpdate.permissionKey) ProjectOperations(com.google.gerrit.acceptance.testsuite.project.ProjectOperations) RecipientType(com.google.gerrit.extensions.api.changes.RecipientType) ResourceConflictException(com.google.gerrit.extensions.restapi.ResourceConflictException) AttentionSetInput(com.google.gerrit.extensions.api.changes.AttentionSetInput) ChangeIndex(com.google.gerrit.server.index.change.ChangeIndex) CacheStatsSubject.cloneStats(com.google.gerrit.truth.CacheStatsSubject.cloneStats) ChangeStatus(com.google.gerrit.extensions.client.ChangeStatus) ChangeInfo(com.google.gerrit.extensions.common.ChangeInfo) ReviewInput(com.google.gerrit.extensions.api.changes.ReviewInput) PushOneCommit(com.google.gerrit.acceptance.PushOneCommit) Test(org.junit.Test) AbstractDaemonTest(com.google.gerrit.acceptance.AbstractDaemonTest)

Example 3 with REVIEWER

use of com.google.gerrit.extensions.client.ReviewerState.REVIEWER in project gerrit by GerritCodeReview.

the class ChangeIT method reviewAndSetWorkInProgressAndAddReviewerAndVote.

@Test
public void reviewAndSetWorkInProgressAndAddReviewerAndVote() throws Exception {
    PushOneCommit.Result r = createChange();
    assertThat(r.getChange().change().isWorkInProgress()).isFalse();
    ReviewInput in = ReviewInput.approve().reviewer(user.email()).label(LabelId.CODE_REVIEW, 1).setWorkInProgress(true);
    gApi.changes().id(r.getChangeId()).current().review(in);
    ChangeInfo info = gApi.changes().id(r.getChangeId()).get();
    assertThat(info.workInProgress).isTrue();
    assertThat(info.reviewers.get(REVIEWER).stream().map(ai -> ai._accountId).collect(toList())).containsExactly(admin.id().get(), user.id().get());
    assertThat(info.labels.get(LabelId.CODE_REVIEW).recommended._accountId).isEqualTo(admin.id().get());
}
Also used : NotifyInfo(com.google.gerrit.extensions.api.changes.NotifyInfo) MERGED(com.google.gerrit.extensions.client.ChangeStatus.MERGED) CHANGE_OWNER(com.google.gerrit.server.group.SystemGroupBackend.CHANGE_OWNER) CommentInfo(com.google.gerrit.extensions.common.CommentInfo) SystemGroupBackend(com.google.gerrit.server.group.SystemGroupBackend) BadRequestException(com.google.gerrit.extensions.restapi.BadRequestException) PushOneCommit(com.google.gerrit.acceptance.PushOneCommit) RevWalk(org.eclipse.jgit.revwalk.RevWalk) TestProjectUpdate.blockLabel(com.google.gerrit.acceptance.testsuite.project.TestProjectUpdate.blockLabel) PROJECT_OWNERS(com.google.gerrit.server.group.SystemGroupBackend.PROJECT_OWNERS) Map(java.util.Map) DraftHandling(com.google.gerrit.extensions.api.changes.ReviewInput.DraftHandling) Side(com.google.gerrit.extensions.client.Side) ThrowableSubject(com.google.common.truth.ThrowableSubject) EnumSet(java.util.EnumSet) FILE_NAME(com.google.gerrit.acceptance.PushOneCommit.FILE_NAME) DeleteVoteInput(com.google.gerrit.extensions.api.changes.DeleteVoteInput) Result(org.eclipse.jgit.lib.RefUpdate.Result) Constants(org.eclipse.jgit.lib.Constants) Collectors.joining(java.util.stream.Collectors.joining) NoHttpd(com.google.gerrit.acceptance.NoHttpd) RequestScopeOperations(com.google.gerrit.acceptance.testsuite.request.RequestScopeOperations) PersonIdent(org.eclipse.jgit.lib.PersonIdent) UseClockStep(com.google.gerrit.acceptance.UseClockStep) Stream(java.util.stream.Stream) DeleteReviewerInput(com.google.gerrit.extensions.api.changes.DeleteReviewerInput) MESSAGES(com.google.gerrit.extensions.client.ListChangesOption.MESSAGES) PushResult(org.eclipse.jgit.transport.PushResult) ProjectInput(com.google.gerrit.extensions.api.projects.ProjectInput) DiffSummary(com.google.gerrit.server.patch.DiffSummary) GerritJUnit.assertThrows(com.google.gerrit.testing.GerritJUnit.assertThrows) Exports(com.google.gerrit.extensions.annotations.Exports) IndexPreloadingUtil(com.google.gerrit.httpd.raw.IndexPreloadingUtil) RevCommit(org.eclipse.jgit.revwalk.RevCommit) ByteArrayOutputStream(java.io.ByteArrayOutputStream) UnprocessableEntityException(com.google.gerrit.extensions.restapi.UnprocessableEntityException) RawInputUtil(com.google.gerrit.common.RawInputUtil) AccountOperations(com.google.gerrit.acceptance.testsuite.account.AccountOperations) ReviewerInput(com.google.gerrit.extensions.api.changes.ReviewerInput) Lists(com.google.common.collect.Lists) LabelFunction(com.google.gerrit.entities.LabelFunction) ExtensionRegistry(com.google.gerrit.acceptance.ExtensionRegistry) TestRepository(org.eclipse.jgit.junit.TestRepository) CURRENT_ACTIONS(com.google.gerrit.extensions.client.ListChangesOption.CURRENT_ACTIONS) ObjectIds.abbreviateName(com.google.gerrit.git.ObjectIds.abbreviateName) IOException(java.io.IOException) Test(org.junit.Test) AccountTemplateUtil(com.google.gerrit.server.util.AccountTemplateUtil) Project(com.google.gerrit.entities.Project) TimeUtil(com.google.gerrit.server.util.time.TimeUtil) Named(com.google.inject.name.Named) FooterConstants(com.google.gerrit.common.FooterConstants) GitUtil.assertPushOk(com.google.gerrit.acceptance.GitUtil.assertPushOk) AbstractModule(com.google.inject.AbstractModule) RefNames.changeMetaRef(com.google.gerrit.entities.RefNames.changeMetaRef) Inject(com.google.inject.Inject) REVIEWER(com.google.gerrit.extensions.client.ReviewerState.REVIEWER) FILE_CONTENT(com.google.gerrit.acceptance.PushOneCommit.FILE_CONTENT) InheritableBoolean(com.google.gerrit.extensions.client.InheritableBoolean) AccountInfo(com.google.gerrit.extensions.common.AccountInfo) LabelType(com.google.gerrit.entities.LabelType) REVIEWED(com.google.gerrit.extensions.client.ListChangesOption.REVIEWED) AuthException(com.google.gerrit.extensions.restapi.AuthException) ChangeInput(com.google.gerrit.extensions.common.ChangeInput) CHECK(com.google.gerrit.extensions.client.ListChangesOption.CHECK) IntraLineDiffKey(com.google.gerrit.server.patch.IntraLineDiffKey) ImmutableSet(com.google.common.collect.ImmutableSet) SubmitType(com.google.gerrit.extensions.client.SubmitType) Timestamp(java.sql.Timestamp) Collection(java.util.Collection) Instant(java.time.Instant) Collectors(java.util.stream.Collectors) Objects(java.util.Objects) ChangeData(com.google.gerrit.server.query.change.ChangeData) RebaseInput(com.google.gerrit.extensions.api.changes.RebaseInput) TestProjectUpdate.block(com.google.gerrit.acceptance.testsuite.project.TestProjectUpdate.block) LabelId(com.google.gerrit.entities.LabelId) DraftInput(com.google.gerrit.extensions.api.changes.DraftInput) Function(java.util.function.Function) MessageFormat(java.text.MessageFormat) BinaryResult(com.google.gerrit.extensions.restapi.BinaryResult) ImmutableList(com.google.common.collect.ImmutableList) Change(com.google.gerrit.entities.Change) Truth8.assertThat(com.google.common.truth.Truth8.assertThat) ChangeContext(com.google.gerrit.server.update.ChangeContext) TestProjectUpdate.allowCapability(com.google.gerrit.acceptance.testsuite.project.TestProjectUpdate.allowCapability) UTF_8(java.nio.charset.StandardCharsets.UTF_8) CHANGE_ACTIONS(com.google.gerrit.extensions.client.ListChangesOption.CHANGE_ACTIONS) Truth.assertThat(com.google.common.truth.Truth.assertThat) Collectors.toList(java.util.stream.Collectors.toList) Message(com.google.gerrit.testing.FakeEmailSender.Message) GerritConfig(com.google.gerrit.acceptance.config.GerritConfig) COMMIT_FOOTERS(com.google.gerrit.extensions.client.ListChangesOption.COMMIT_FOOTERS) Cache(com.google.common.cache.Cache) StarredChangesUtil(com.google.gerrit.server.StarredChangesUtil) TestProjectUpdate.labelPermissionKey(com.google.gerrit.acceptance.testsuite.project.TestProjectUpdate.labelPermissionKey) ResourceNotFoundException(com.google.gerrit.extensions.restapi.ResourceNotFoundException) Arrays(java.util.Arrays) LabelInfo(com.google.gerrit.extensions.common.LabelInfo) GlobalCapability(com.google.gerrit.common.data.GlobalCapability) TrackingIdInfo(com.google.gerrit.extensions.common.TrackingIdInfo) TestAccount(com.google.gerrit.acceptance.TestAccount) REGISTERED_USERS(com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS) CommitReceivedEvent(com.google.gerrit.server.events.CommitReceivedEvent) ReviewResult(com.google.gerrit.extensions.api.changes.ReviewResult) DiffSummaryKey(com.google.gerrit.server.patch.DiffSummaryKey) Registration(com.google.gerrit.acceptance.ExtensionRegistry.Registration) ConfigInput(com.google.gerrit.extensions.api.projects.ConfigInput) GroupOperations(com.google.gerrit.acceptance.testsuite.group.GroupOperations) TestProjectUpdate.allow(com.google.gerrit.acceptance.testsuite.project.TestProjectUpdate.allow) DeleteDraftCommentsInput(com.google.gerrit.extensions.api.accounts.DeleteDraftCommentsInput) ApprovalInfo(com.google.gerrit.extensions.common.ApprovalInfo) ChangeMessages(com.google.gerrit.server.change.ChangeMessages) ChangeOperatorFactory(com.google.gerrit.server.query.change.ChangeQueryBuilder.ChangeOperatorFactory) Set(java.util.Set) RefUpdate(org.eclipse.jgit.lib.RefUpdate) TestLabels.label(com.google.gerrit.server.project.testing.TestLabels.label) TestLabels.value(com.google.gerrit.server.project.testing.TestLabels.value) BranchNameKey(com.google.gerrit.entities.BranchNameKey) NotifyHandling(com.google.gerrit.extensions.api.changes.NotifyHandling) ImmutableMap.toImmutableMap(com.google.common.collect.ImmutableMap.toImmutableMap) AbstractDaemonTest(com.google.gerrit.acceptance.AbstractDaemonTest) CacheStats(com.google.common.cache.CacheStats) ChangeMessagesUtil(com.google.gerrit.server.ChangeMessagesUtil) Iterables(com.google.common.collect.Iterables) BranchInput(com.google.gerrit.extensions.api.projects.BranchInput) ReviewerResult(com.google.gerrit.extensions.api.changes.ReviewerResult) TestChangeETagComputation(com.google.gerrit.server.change.testing.TestChangeETagComputation) TestLabels(com.google.gerrit.server.project.testing.TestLabels) ArrayList(java.util.ArrayList) CURRENT_COMMIT(com.google.gerrit.extensions.client.ListChangesOption.CURRENT_COMMIT) ChangeMessageModifier(com.google.gerrit.server.git.ChangeMessageModifier) PatchSet(com.google.gerrit.entities.PatchSet) RestApiException(com.google.gerrit.extensions.restapi.RestApiException) GitUtil(com.google.gerrit.acceptance.GitUtil) Address(com.google.gerrit.entities.Address) WorkInProgressStateChangedListener(com.google.gerrit.extensions.events.WorkInProgressStateChangedListener) AccountGroup(com.google.gerrit.entities.AccountGroup) CommitValidationMessage(com.google.gerrit.server.git.validators.CommitValidationMessage) CacheStatsSubject.assertThat(com.google.gerrit.truth.CacheStatsSubject.assertThat) StorageException(com.google.gerrit.exceptions.StorageException) ChangeIndexedCounter(com.google.gerrit.acceptance.ChangeIndexedCounter) ANONYMOUS_USERS(com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS) CommitValidationListener(com.google.gerrit.server.git.validators.CommitValidationListener) ReviewInput(com.google.gerrit.extensions.api.changes.ReviewInput) ChangeKind(com.google.gerrit.extensions.client.ChangeKind) ChangeIndexCollection(com.google.gerrit.server.index.change.ChangeIndexCollection) Repository(org.eclipse.jgit.lib.Repository) REMOVED(com.google.gerrit.extensions.client.ReviewerState.REMOVED) ALL_REVISIONS(com.google.gerrit.extensions.client.ListChangesOption.ALL_REVISIONS) RevisionInfo(com.google.gerrit.extensions.common.RevisionInfo) GroupApi(com.google.gerrit.extensions.api.groups.GroupApi) PUSH_CERTIFICATES(com.google.gerrit.extensions.client.ListChangesOption.PUSH_CERTIFICATES) IntraLineDiff(com.google.gerrit.server.patch.IntraLineDiff) PostFilterPredicate(com.google.gerrit.index.query.PostFilterPredicate) DraftApi(com.google.gerrit.extensions.api.changes.DraftApi) BatchUpdate(com.google.gerrit.server.update.BatchUpdate) DEFAULT_LABEL(com.google.gerrit.server.StarredChangesUtil.DEFAULT_LABEL) RefNames(com.google.gerrit.entities.RefNames) Collectors.toSet(java.util.stream.Collectors.toSet) PostReview(com.google.gerrit.server.restapi.change.PostReview) ReviewerInfo(com.google.gerrit.extensions.api.changes.ReviewerInfo) Truth.assertWithMessage(com.google.common.truth.Truth.assertWithMessage) ImmutableMap(com.google.common.collect.ImmutableMap) VerifyNoPiiInChangeNotes(com.google.gerrit.acceptance.VerifyNoPiiInChangeNotes) RevisionApi(com.google.gerrit.extensions.api.changes.RevisionApi) DETAILED_LABELS(com.google.gerrit.extensions.client.ListChangesOption.DETAILED_LABELS) Account(com.google.gerrit.entities.Account) CommitInfo(com.google.gerrit.extensions.common.CommitInfo) MethodNotAllowedException(com.google.gerrit.extensions.restapi.MethodNotAllowedException) List(java.util.List) Optional(java.util.Optional) BatchUpdateOp(com.google.gerrit.server.update.BatchUpdateOp) GitPerson(com.google.gerrit.extensions.common.GitPerson) TestProjectUpdate.allowLabel(com.google.gerrit.acceptance.testsuite.project.TestProjectUpdate.allowLabel) IndexConfig(com.google.gerrit.index.IndexConfig) CC(com.google.gerrit.extensions.client.ReviewerState.CC) InMemoryRepository(org.eclipse.jgit.internal.storage.dfs.InMemoryRepository) RelatedChangeAndCommitInfo(com.google.gerrit.extensions.api.changes.RelatedChangeAndCommitInfo) ReviewerState(com.google.gerrit.extensions.client.ReviewerState) HashMap(java.util.HashMap) TestProjectInput(com.google.gerrit.acceptance.TestProjectInput) UseTimezone(com.google.gerrit.acceptance.UseTimezone) ChangeResource(com.google.gerrit.server.change.ChangeResource) SUBJECT(com.google.gerrit.acceptance.PushOneCommit.SUBJECT) Range(com.google.gerrit.extensions.client.Comment.Range) CURRENT_REVISION(com.google.gerrit.extensions.client.ListChangesOption.CURRENT_REVISION) ChangeInfo(com.google.gerrit.extensions.common.ChangeInfo) ListChangesOption(com.google.gerrit.extensions.client.ListChangesOption) GitUtil.pushHead(com.google.gerrit.acceptance.GitUtil.pushHead) TRACKING_IDS(com.google.gerrit.extensions.client.ListChangesOption.TRACKING_IDS) CommitValidationException(com.google.gerrit.server.git.validators.CommitValidationException) Iterator(java.util.Iterator) Permission(com.google.gerrit.entities.Permission) ChangeMessageInfo(com.google.gerrit.extensions.common.ChangeMessageInfo) IndexedChangeQuery(com.google.gerrit.server.index.change.IndexedChangeQuery) TestProjectUpdate.permissionKey(com.google.gerrit.acceptance.testsuite.project.TestProjectUpdate.permissionKey) ProjectOperations(com.google.gerrit.acceptance.testsuite.project.ProjectOperations) RecipientType(com.google.gerrit.extensions.api.changes.RecipientType) ResourceConflictException(com.google.gerrit.extensions.restapi.ResourceConflictException) AttentionSetInput(com.google.gerrit.extensions.api.changes.AttentionSetInput) ChangeIndex(com.google.gerrit.server.index.change.ChangeIndex) CacheStatsSubject.cloneStats(com.google.gerrit.truth.CacheStatsSubject.cloneStats) ChangeStatus(com.google.gerrit.extensions.client.ChangeStatus) ChangeInfo(com.google.gerrit.extensions.common.ChangeInfo) ReviewInput(com.google.gerrit.extensions.api.changes.ReviewInput) PushOneCommit(com.google.gerrit.acceptance.PushOneCommit) Test(org.junit.Test) AbstractDaemonTest(com.google.gerrit.acceptance.AbstractDaemonTest)

Aggregations

Cache (com.google.common.cache.Cache)3 CacheStats (com.google.common.cache.CacheStats)3 ImmutableList (com.google.common.collect.ImmutableList)3 ImmutableMap (com.google.common.collect.ImmutableMap)3 ImmutableMap.toImmutableMap (com.google.common.collect.ImmutableMap.toImmutableMap)3 ImmutableSet (com.google.common.collect.ImmutableSet)3 Iterables (com.google.common.collect.Iterables)3 Lists (com.google.common.collect.Lists)3 ThrowableSubject (com.google.common.truth.ThrowableSubject)3 Truth.assertThat (com.google.common.truth.Truth.assertThat)3 Truth.assertWithMessage (com.google.common.truth.Truth.assertWithMessage)3 Truth8.assertThat (com.google.common.truth.Truth8.assertThat)3 AbstractDaemonTest (com.google.gerrit.acceptance.AbstractDaemonTest)3 ChangeIndexedCounter (com.google.gerrit.acceptance.ChangeIndexedCounter)3 ExtensionRegistry (com.google.gerrit.acceptance.ExtensionRegistry)3 Registration (com.google.gerrit.acceptance.ExtensionRegistry.Registration)3 GitUtil (com.google.gerrit.acceptance.GitUtil)3 GitUtil.assertPushOk (com.google.gerrit.acceptance.GitUtil.assertPushOk)3 GitUtil.pushHead (com.google.gerrit.acceptance.GitUtil.pushHead)3 NoHttpd (com.google.gerrit.acceptance.NoHttpd)3