Search in sources :

Example 6 with UseClockStep

use of com.google.gerrit.acceptance.UseClockStep in project gerrit by GerritCodeReview.

the class AccountIT method deleteAllDraftComments.

@Test
@UseClockStep
public void deleteAllDraftComments() throws Exception {
    try {
        Project.NameKey project2 = projectOperations.newProject().create();
        PushOneCommit.Result r1 = createChange();
        TestRepository<?> tr2 = cloneProject(project2);
        PushOneCommit.Result r2 = createChange(tr2, "refs/heads/master", "Change in project2", PushOneCommit.FILE_NAME, "content2", null);
        // Create 2 drafts each on both changes for user.
        requestScopeOperations.setApiUser(user.id());
        createDraft(r1, PushOneCommit.FILE_NAME, "draft 1a");
        createDraft(r1, PushOneCommit.FILE_NAME, "draft 1b");
        createDraft(r2, PushOneCommit.FILE_NAME, "draft 2a");
        createDraft(r2, PushOneCommit.FILE_NAME, "draft 2b");
        assertThat(gApi.changes().id(r1.getChangeId()).current().draftsAsList()).hasSize(2);
        assertThat(gApi.changes().id(r2.getChangeId()).current().draftsAsList()).hasSize(2);
        // Create 1 draft on first change for admin.
        requestScopeOperations.setApiUser(admin.id());
        createDraft(r1, PushOneCommit.FILE_NAME, "admin draft");
        assertThat(gApi.changes().id(r1.getChangeId()).current().draftsAsList()).hasSize(1);
        // Delete user's draft comments; leave admin's alone.
        requestScopeOperations.setApiUser(user.id());
        List<DeletedDraftCommentInfo> result = gApi.accounts().self().deleteDraftComments(new DeleteDraftCommentsInput());
        // Results are ordered according to the change search, most recently updated first.
        assertThat(result).hasSize(2);
        DeletedDraftCommentInfo del2 = result.get(0);
        assertThat(del2.change.changeId).isEqualTo(r2.getChangeId());
        assertThat(del2.deleted.stream().map(c -> c.message)).containsExactly("draft 2a", "draft 2b");
        DeletedDraftCommentInfo del1 = result.get(1);
        assertThat(del1.change.changeId).isEqualTo(r1.getChangeId());
        assertThat(del1.deleted.stream().map(c -> c.message)).containsExactly("draft 1a", "draft 1b");
        assertThat(gApi.changes().id(r1.getChangeId()).current().draftsAsList()).isEmpty();
        assertThat(gApi.changes().id(r2.getChangeId()).current().draftsAsList()).isEmpty();
        requestScopeOperations.setApiUser(admin.id());
        assertThat(gApi.changes().id(r1.getChangeId()).current().draftsAsList()).hasSize(1);
    } finally {
        cleanUpDrafts();
    }
}
Also used : DeletedDraftCommentInfo(com.google.gerrit.extensions.api.accounts.DeletedDraftCommentInfo) Project(com.google.gerrit.entities.Project) DeleteDraftCommentsInput(com.google.gerrit.extensions.api.accounts.DeleteDraftCommentsInput) PushOneCommit(com.google.gerrit.acceptance.PushOneCommit) AbstractDaemonTest(com.google.gerrit.acceptance.AbstractDaemonTest) Test(org.junit.Test) UseClockStep(com.google.gerrit.acceptance.UseClockStep)

Example 7 with UseClockStep

use of com.google.gerrit.acceptance.UseClockStep in project gerrit by GerritCodeReview.

the class AccountIT method createAtomically.

@Test
@UseClockStep
public void createAtomically() throws Exception {
    Account.Id accountId = Account.id(seq.nextAccountId());
    String fullName = "Foo";
    ExternalId extId = externalIdFactory.createEmail(accountId, "foo@example.com");
    AccountState accountState = accountsUpdateProvider.get().insert("Create Account Atomically", accountId, u -> u.setFullName(fullName).addExternalId(extId));
    assertThat(accountState.account().fullName()).isEqualTo(fullName);
    AccountInfo info = gApi.accounts().id(accountId.get()).get();
    assertThat(info.name).isEqualTo(fullName);
    List<EmailInfo> emails = gApi.accounts().id(accountId.get()).getEmails();
    assertThat(emails.stream().map(e -> e.email).collect(toSet())).containsExactly(extId.email());
    RevCommit commitUserBranch = projectOperations.project(allUsers).getHead(RefNames.refsUsers(accountId));
    RevCommit commitRefsMetaExternalIds = projectOperations.project(allUsers).getHead(RefNames.REFS_EXTERNAL_IDS);
    assertThat(commitUserBranch.getCommitTime()).isEqualTo(commitRefsMetaExternalIds.getCommitTime());
}
Also used : ResourceNotFoundException(com.google.gerrit.extensions.restapi.ResourceNotFoundException) ExternalIdKeyFactory(com.google.gerrit.server.account.externalids.ExternalIdKeyFactory) KeyPair(java.security.KeyPair) Arrays(java.util.Arrays) OBJ_BLOB(org.eclipse.jgit.lib.Constants.OBJ_BLOB) GlobalCapability(com.google.gerrit.common.data.GlobalCapability) CommentInfo(com.google.gerrit.extensions.common.CommentInfo) PublicKeyStore.keyToString(com.google.gerrit.gpg.PublicKeyStore.keyToString) TestAccount(com.google.gerrit.acceptance.TestAccount) TestProjectUpdate.deny(com.google.gerrit.acceptance.testsuite.project.TestProjectUpdate.deny) REGISTERED_USERS(com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS) BadRequestException(com.google.gerrit.extensions.restapi.BadRequestException) PushOneCommit(com.google.gerrit.acceptance.PushOneCommit) RevWalk(org.eclipse.jgit.revwalk.RevWalk) Config(org.eclipse.jgit.lib.Config) TestKey(com.google.gerrit.gpg.testing.TestKey) Registration(com.google.gerrit.acceptance.ExtensionRegistry.Registration) FluentIterable(com.google.common.collect.FluentIterable) GpgKeyInfo(com.google.gerrit.extensions.common.GpgKeyInfo) Map(java.util.Map) RetryHelper(com.google.gerrit.server.update.RetryHelper) 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) DeletedDraftCommentInfo(com.google.gerrit.extensions.api.accounts.DeletedDraftCommentInfo) GitUtil.deleteRef(com.google.gerrit.acceptance.GitUtil.deleteRef) ImmutableList.toImmutableList(com.google.common.collect.ImmutableList.toImmutableList) AccessSection(com.google.gerrit.entities.AccessSection) ConsistencyCheckInfo(com.google.gerrit.extensions.api.config.ConsistencyCheckInfo) Set(java.util.Set) RefUpdate(org.eclipse.jgit.lib.RefUpdate) PGPPublicKey(org.bouncycastle.openpgp.PGPPublicKey) TestKeys.validKeyWithoutExpiration(com.google.gerrit.gpg.testing.TestKeys.validKeyWithoutExpiration) BranchNameKey(com.google.gerrit.entities.BranchNameKey) ExternalIds(com.google.gerrit.server.account.externalids.ExternalIds) RequestScopeOperations(com.google.gerrit.acceptance.testsuite.request.RequestScopeOperations) PersonIdent(org.eclipse.jgit.lib.PersonIdent) UseClockStep(com.google.gerrit.acceptance.UseClockStep) AccountProperties(com.google.gerrit.server.account.AccountProperties) Emails(com.google.gerrit.server.account.Emails) PushResult(org.eclipse.jgit.transport.PushResult) PluginSetContext(com.google.gerrit.server.plugincontext.PluginSetContext) AbstractDaemonTest(com.google.gerrit.acceptance.AbstractDaemonTest) GerritJUnit.assertThrows(com.google.gerrit.testing.GerritJUnit.assertThrows) GitUtil.fetch(com.google.gerrit.acceptance.GitUtil.fetch) Mockito.mock(org.mockito.Mockito.mock) EmailInfo(com.google.gerrit.extensions.common.EmailInfo) MetaDataUpdate(com.google.gerrit.server.git.meta.MetaDataUpdate) ClientProtocolException(org.apache.http.client.ClientProtocolException) Iterables(com.google.common.collect.Iterables) ConfigInvalidException(org.eclipse.jgit.errors.ConfigInvalidException) RevCommit(org.eclipse.jgit.revwalk.RevCommit) ByteArrayOutputStream(java.io.ByteArrayOutputStream) UnprocessableEntityException(com.google.gerrit.extensions.restapi.UnprocessableEntityException) AccountOperations(com.google.gerrit.acceptance.testsuite.account.AccountOperations) Fingerprint(com.google.gerrit.gpg.Fingerprint) ArrayList(java.util.ArrayList) AccountInput(com.google.gerrit.extensions.api.accounts.AccountInput) ReviewerInput(com.google.gerrit.extensions.api.changes.ReviewerInput) TestKeys.validKeyWithExpiration(com.google.gerrit.gpg.testing.TestKeys.validKeyWithExpiration) Runnables(com.google.common.util.concurrent.Runnables) EmailInput(com.google.gerrit.extensions.api.accounts.EmailInput) RestApiException(com.google.gerrit.extensions.restapi.RestApiException) Address(com.google.gerrit.entities.Address) ExtensionRegistry(com.google.gerrit.acceptance.ExtensionRegistry) Before(org.junit.Before) AccountGroup(com.google.gerrit.entities.AccountGroup) TreeWalk(org.eclipse.jgit.treewalk.TreeWalk) ProjectCache.illegalState(com.google.gerrit.server.project.ProjectCache.illegalState) TestRepository(org.eclipse.jgit.junit.TestRepository) Sequences(com.google.gerrit.server.notedb.Sequences) BaseEncoding(com.google.common.io.BaseEncoding) ValidationException(com.google.gerrit.server.validators.ValidationException) StorageException(com.google.gerrit.exceptions.StorageException) AccountActivationListener(com.google.gerrit.extensions.events.AccountActivationListener) IOException(java.io.IOException) Test(org.junit.Test) ANONYMOUS_USERS(com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS) StalenessChecker(com.google.gerrit.server.index.account.StalenessChecker) Correspondence(com.google.common.truth.Correspondence) BasicCookieStore(org.apache.http.impl.client.BasicCookieStore) AccountApi(com.google.gerrit.extensions.api.accounts.AccountApi) CacheBasedWebSession(com.google.gerrit.httpd.CacheBasedWebSession) ReviewInput(com.google.gerrit.extensions.api.changes.ReviewInput) ExternalIdNotes(com.google.gerrit.server.account.externalids.ExternalIdNotes) Project(com.google.gerrit.entities.Project) HttpResponse(org.apache.http.HttpResponse) ExternalId(com.google.gerrit.server.account.externalids.ExternalId) TimeUtil(com.google.gerrit.server.util.time.TimeUtil) HttpClientBuilder(org.apache.http.impl.client.HttpClientBuilder) AccountState(com.google.gerrit.server.account.AccountState) ObjectReader(org.eclipse.jgit.lib.ObjectReader) Repository(org.eclipse.jgit.lib.Repository) ObjectInserter(org.eclipse.jgit.lib.ObjectInserter) Date(java.util.Date) Inject(com.google.inject.Inject) REFS_GPG_KEYS(com.google.gerrit.gpg.PublicKeyStore.REFS_GPG_KEYS) Mockito.verifyNoInteractions(org.mockito.Mockito.verifyNoInteractions) AccountDetailInfo(com.google.gerrit.extensions.common.AccountDetailInfo) AccountInfo(com.google.gerrit.extensions.common.AccountInfo) DEFAULT_LABEL(com.google.gerrit.server.StarredChangesUtil.DEFAULT_LABEL) Mockito.verifyNoMoreInteractions(org.mockito.Mockito.verifyNoMoreInteractions) ConsistencyProblemInfo(com.google.gerrit.extensions.api.config.ConsistencyCheckInfo.ConsistencyProblemInfo) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) CheckAccountsInput(com.google.gerrit.extensions.api.config.ConsistencyCheckInput.CheckAccountsInput) Locale(java.util.Locale) After(org.junit.After) RefNames(com.google.gerrit.entities.RefNames) AuthException(com.google.gerrit.extensions.restapi.AuthException) PGPPublicKeyRing(org.bouncycastle.openpgp.PGPPublicKeyRing) AtomicLongMap(com.google.common.util.concurrent.AtomicLongMap) Collectors.toSet(java.util.stream.Collectors.toSet) ImmutableSetMultimap(com.google.common.collect.ImmutableSetMultimap) ImmutableSet(com.google.common.collect.ImmutableSet) Truth.assertWithMessage(com.google.common.truth.Truth.assertWithMessage) SshSessionFactory(com.google.gerrit.acceptance.testsuite.request.SshSessionFactory) Account(com.google.gerrit.entities.Account) SCHEME_GPGKEY(com.google.gerrit.server.account.externalids.ExternalId.SCHEME_GPGKEY) AccountIndexedCounter(com.google.gerrit.acceptance.AccountIndexedCounter) Collectors(java.util.stream.Collectors) TestSshKeys(com.google.gerrit.acceptance.testsuite.account.TestSshKeys) GroupReference(com.google.gerrit.entities.GroupReference) List(java.util.List) Nullable(com.google.gerrit.common.Nullable) StopStrategies(com.github.rholder.retry.StopStrategies) HttpGet(org.apache.http.client.methods.HttpGet) Ref(org.eclipse.jgit.lib.Ref) ConfigSubject.assertThat(com.google.gerrit.truth.ConfigSubject.assertThat) Optional(java.util.Optional) AuthConfig(com.google.gerrit.server.config.AuthConfig) RefPattern(com.google.gerrit.server.project.RefPattern) AccountIndexer(com.google.gerrit.server.index.account.AccountIndexer) TestProjectUpdate.block(com.google.gerrit.acceptance.testsuite.project.TestProjectUpdate.block) VersionedAuthorizedKeys(com.google.gerrit.server.account.VersionedAuthorizedKeys) DraftInput(com.google.gerrit.extensions.api.changes.DraftInput) InMemoryRepository(org.eclipse.jgit.internal.storage.dfs.InMemoryRepository) PublicKeyStore(com.google.gerrit.gpg.PublicKeyStore) InternalAccountQuery(com.google.gerrit.server.query.account.InternalAccountQuery) SshKeyInfo(com.google.gerrit.extensions.common.SshKeyInfo) AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) HashMap(java.util.HashMap) ConfigSuite(com.google.gerrit.testing.ConfigSuite) HashSet(java.util.HashSet) GitReferenceUpdatedListener(com.google.gerrit.extensions.events.GitReferenceUpdatedListener) GroupInfo(com.google.gerrit.extensions.common.GroupInfo) ImmutableList(com.google.common.collect.ImmutableList) UseSsh(com.google.gerrit.acceptance.UseSsh) ExceptionHook(com.google.gerrit.server.ExceptionHook) CommitBuilder(org.eclipse.jgit.lib.CommitBuilder) Objects.requireNonNull(java.util.Objects.requireNonNull) ChangeInfo(com.google.gerrit.extensions.common.ChangeInfo) ExternalIdFactory(com.google.gerrit.server.account.externalids.ExternalIdFactory) Change(com.google.gerrit.entities.Change) LockFailureException(com.google.gerrit.git.LockFailureException) Truth8.assertThat(com.google.common.truth.Truth8.assertThat) ConsistencyCheckInput(com.google.gerrit.extensions.api.config.ConsistencyCheckInput) AccountActivationValidationListener(com.google.gerrit.server.validators.AccountActivationValidationListener) AccountsUpdate(com.google.gerrit.server.account.AccountsUpdate) TestProjectUpdate.allowCapability(com.google.gerrit.acceptance.testsuite.project.TestProjectUpdate.allowCapability) CloseableHttpClient(org.apache.http.impl.client.CloseableHttpClient) Iterator(java.util.Iterator) Sandboxed(com.google.gerrit.acceptance.Sandboxed) UTF_8(java.nio.charset.StandardCharsets.UTF_8) Permission(com.google.gerrit.entities.Permission) HttpServletResponse(javax.servlet.http.HttpServletResponse) Truth.assertThat(com.google.common.truth.Truth.assertThat) Mockito.verify(org.mockito.Mockito.verify) ObjectId(org.eclipse.jgit.lib.ObjectId) TransportException(org.eclipse.jgit.api.errors.TransportException) TestProjectUpdate.permissionKey(com.google.gerrit.acceptance.testsuite.project.TestProjectUpdate.permissionKey) ArmoredOutputStream(org.bouncycastle.bcpg.ArmoredOutputStream) Collectors.toList(java.util.stream.Collectors.toList) Provider(com.google.inject.Provider) Message(com.google.gerrit.testing.FakeEmailSender.Message) ProjectOperations(com.google.gerrit.acceptance.testsuite.project.ProjectOperations) RemoteRefUpdate(org.eclipse.jgit.transport.RemoteRefUpdate) ResourceConflictException(com.google.gerrit.extensions.restapi.ResourceConflictException) ServerInitiated(com.google.gerrit.server.ServerInitiated) GerritConfig(com.google.gerrit.acceptance.config.GerritConfig) NullAwareCorrespondence(com.google.gerrit.truth.NullAwareCorrespondence) DuplicateExternalIdKeyException(com.google.gerrit.server.account.externalids.DuplicateExternalIdKeyException) Git(org.eclipse.jgit.api.Git) TestKeys.allValidKeys(com.google.gerrit.gpg.testing.TestKeys.allValidKeys) TestKeys.validKeyWithSecondUserId(com.google.gerrit.gpg.testing.TestKeys.validKeyWithSecondUserId) PushCertificateIdent(org.eclipse.jgit.transport.PushCertificateIdent) SECONDS(java.util.concurrent.TimeUnit.SECONDS) Action(com.google.gerrit.entities.PermissionRule.Action) GitReferenceUpdated(com.google.gerrit.server.extensions.events.GitReferenceUpdated) TestAccount(com.google.gerrit.acceptance.TestAccount) Account(com.google.gerrit.entities.Account) ExternalId(com.google.gerrit.server.account.externalids.ExternalId) EmailInfo(com.google.gerrit.extensions.common.EmailInfo) PublicKeyStore.keyToString(com.google.gerrit.gpg.PublicKeyStore.keyToString) AccountState(com.google.gerrit.server.account.AccountState) AccountInfo(com.google.gerrit.extensions.common.AccountInfo) RevCommit(org.eclipse.jgit.revwalk.RevCommit) AbstractDaemonTest(com.google.gerrit.acceptance.AbstractDaemonTest) Test(org.junit.Test) UseClockStep(com.google.gerrit.acceptance.UseClockStep)

Example 8 with UseClockStep

use of com.google.gerrit.acceptance.UseClockStep in project gerrit by GerritCodeReview.

the class ChangeIT method addSelfAsReviewer.

@Test
@UseClockStep
public void addSelfAsReviewer() throws Exception {
    PushOneCommit.Result r = createChange();
    ChangeResource rsrc = parseResource(r);
    String oldETag = rsrc.getETag();
    Instant oldTs = rsrc.getChange().getLastUpdatedOn();
    ReviewerInput in = new ReviewerInput();
    in.reviewer = user.email();
    requestScopeOperations.setApiUser(user.id());
    gApi.changes().id(r.getChangeId()).addReviewer(in);
    // There should be no email notification when adding self
    assertThat(sender.getMessages()).isEmpty();
    // Adding a reviewer records that user as reviewer.
    ChangeInfo c = gApi.changes().id(r.getChangeId()).get();
    Collection<AccountInfo> reviewers = c.reviewers.get(REVIEWER);
    assertThat(reviewers).isNotNull();
    assertThat(reviewers).hasSize(1);
    assertThat(reviewers.iterator().next()._accountId).isEqualTo(user.id().get());
    // Ensure ETag and lastUpdatedOn are updated.
    rsrc = parseResource(r);
    assertThat(rsrc.getETag()).isNotEqualTo(oldETag);
    assertThat(rsrc.getChange().getLastUpdatedOn()).isNotEqualTo(oldTs);
}
Also used : ChangeResource(com.google.gerrit.server.change.ChangeResource) ChangeInfo(com.google.gerrit.extensions.common.ChangeInfo) Instant(java.time.Instant) PushOneCommit(com.google.gerrit.acceptance.PushOneCommit) AccountInfo(com.google.gerrit.extensions.common.AccountInfo) DeleteReviewerInput(com.google.gerrit.extensions.api.changes.DeleteReviewerInput) ReviewerInput(com.google.gerrit.extensions.api.changes.ReviewerInput) Test(org.junit.Test) AbstractDaemonTest(com.google.gerrit.acceptance.AbstractDaemonTest) UseClockStep(com.google.gerrit.acceptance.UseClockStep)

Example 9 with UseClockStep

use of com.google.gerrit.acceptance.UseClockStep in project gerrit by GerritCodeReview.

the class ChangeIT method addReviewerViaPostReview.

@Test
@UseClockStep
public void addReviewerViaPostReview() throws Exception {
    testAddReviewerViaPostReview((changeId, reviewer) -> {
        ReviewerInput reviewerInput = new ReviewerInput();
        reviewerInput.reviewer = reviewer;
        ReviewInput reviewInput = new ReviewInput();
        reviewInput.reviewers = ImmutableList.of(reviewerInput);
        gApi.changes().id(changeId).current().review(reviewInput);
    });
}
Also used : ReviewInput(com.google.gerrit.extensions.api.changes.ReviewInput) DeleteReviewerInput(com.google.gerrit.extensions.api.changes.DeleteReviewerInput) ReviewerInput(com.google.gerrit.extensions.api.changes.ReviewerInput) Test(org.junit.Test) AbstractDaemonTest(com.google.gerrit.acceptance.AbstractDaemonTest) UseClockStep(com.google.gerrit.acceptance.UseClockStep)

Example 10 with UseClockStep

use of com.google.gerrit.acceptance.UseClockStep in project gerrit by GerritCodeReview.

the class QueryChangesIT method withPagedResults.

@Test
@UseClockStep
@SuppressWarnings("unchecked")
public void withPagedResults() throws Exception {
    // Create 4 visible changes.
    createChange(testRepo).getChange().getId().get();
    createChange(testRepo).getChange().getId().get();
    int changeId3 = createChange(testRepo).getChange().getId().get();
    int changeId4 = createChange(testRepo).getChange().getId().get();
    // Create hidden project.
    Project.NameKey hiddenProject = projectOperations.newProject().create();
    TestRepository<InMemoryRepository> hiddenRepo = cloneProject(hiddenProject, admin);
    // Create 2 hidden changes.
    createChange(hiddenRepo);
    createChange(hiddenRepo);
    // Actually hide project
    projectOperations.project(hiddenProject).forUpdate().add(block(Permission.READ).ref("refs/*").group(REGISTERED_USERS)).update();
    // Create a change query that matches all changes (visible and hidden changes).
    // The index returns the changes ordered by last updated timestamp:
    // hiddenChange2, hiddenChange1, change4, change3, change2, change1
    QueryChanges queryChanges = queryChangesProvider.get();
    queryChanges.addQuery("branch:master");
    // Set a limit on the query so that we need to paginate over the results from the index.
    queryChanges.setLimit(2);
    // Execute the query and verify the results.
    // Since the limit is set to 2, at most 2 changes are returned to user, but the index query is
    // executed with limit 3 (+1 so that we can populate the _more_changes field on the last
    // result).
    // This means the index query with limit 3 returns these changes:
    // hiddenChange2, hiddenChange1, change4
    // The 2 hidden changes are filtered out because they are not visible to the caller.
    // This means we have only one matching result (change4) but the limit (3) is not exhausted
    // yet. Hence the next page is loaded from the index (startIndex is 3 to skip the results
    // that we already processed, limit is again 3). The results for the next page are:
    // change3, change2, change1
    // change2 and change1 are dropped because they are over the limit.
    List<ChangeInfo> result = (List<ChangeInfo>) queryChanges.apply(TopLevelResource.INSTANCE).value();
    assertThat(result.stream().map(i -> i._number).collect(toList())).containsExactly(changeId3, changeId4);
}
Also used : TestProjectUpdate.block(com.google.gerrit.acceptance.testsuite.project.TestProjectUpdate.block) Patch(com.google.gerrit.entities.Patch) Arrays(java.util.Arrays) ProjectConfig(com.google.gerrit.server.project.ProjectConfig) InMemoryRepository(org.eclipse.jgit.internal.storage.dfs.InMemoryRepository) Inject(com.google.inject.Inject) RestResponse(com.google.gerrit.acceptance.RestResponse) REGISTERED_USERS(com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS) BadRequestException(com.google.gerrit.extensions.restapi.BadRequestException) AccountOperations(com.google.gerrit.acceptance.testsuite.account.AccountOperations) PushOneCommit(com.google.gerrit.acceptance.PushOneCommit) ImmutableList(com.google.common.collect.ImmutableList) ChangeInfo(com.google.gerrit.extensions.common.ChangeInfo) AuthException(com.google.gerrit.extensions.restapi.AuthException) QueryChanges(com.google.gerrit.server.restapi.change.QueryChanges) TestRepository(org.eclipse.jgit.junit.TestRepository) ImmutableMap(com.google.common.collect.ImmutableMap) AccessSection(com.google.gerrit.entities.AccessSection) Permission(com.google.gerrit.entities.Permission) Account(com.google.gerrit.entities.Account) Test(org.junit.Test) Truth.assertThat(com.google.common.truth.Truth.assertThat) TopLevelResource(com.google.gerrit.extensions.restapi.TopLevelResource) RequestScopeOperations(com.google.gerrit.acceptance.testsuite.request.RequestScopeOperations) UseClockStep(com.google.gerrit.acceptance.UseClockStep) Collectors.toList(java.util.stream.Collectors.toList) Provider(com.google.inject.Provider) List(java.util.List) ProjectOperations(com.google.gerrit.acceptance.testsuite.project.ProjectOperations) SC_OK(javax.servlet.http.HttpServletResponse.SC_OK) ReviewInput(com.google.gerrit.extensions.api.changes.ReviewInput) GerritConfig(com.google.gerrit.acceptance.config.GerritConfig) Project(com.google.gerrit.entities.Project) AbstractDaemonTest(com.google.gerrit.acceptance.AbstractDaemonTest) GerritJUnit.assertThrows(com.google.gerrit.testing.GerritJUnit.assertThrows) Project(com.google.gerrit.entities.Project) InMemoryRepository(org.eclipse.jgit.internal.storage.dfs.InMemoryRepository) ChangeInfo(com.google.gerrit.extensions.common.ChangeInfo) ImmutableList(com.google.common.collect.ImmutableList) Collectors.toList(java.util.stream.Collectors.toList) List(java.util.List) QueryChanges(com.google.gerrit.server.restapi.change.QueryChanges) Test(org.junit.Test) AbstractDaemonTest(com.google.gerrit.acceptance.AbstractDaemonTest) UseClockStep(com.google.gerrit.acceptance.UseClockStep)

Aggregations

UseClockStep (com.google.gerrit.acceptance.UseClockStep)16 Test (org.junit.Test)16 AbstractDaemonTest (com.google.gerrit.acceptance.AbstractDaemonTest)13 PushOneCommit (com.google.gerrit.acceptance.PushOneCommit)11 GerritConfig (com.google.gerrit.acceptance.config.GerritConfig)8 ChangeInfo (com.google.gerrit.extensions.common.ChangeInfo)7 ReviewerInput (com.google.gerrit.extensions.api.changes.ReviewerInput)6 Project (com.google.gerrit.entities.Project)5 DeleteReviewerInput (com.google.gerrit.extensions.api.changes.DeleteReviewerInput)5 ReviewInput (com.google.gerrit.extensions.api.changes.ReviewInput)4 AccountInfo (com.google.gerrit.extensions.common.AccountInfo)4 BadRequestException (com.google.gerrit.extensions.restapi.BadRequestException)4 ImmutableList (com.google.common.collect.ImmutableList)3 Truth.assertThat (com.google.common.truth.Truth.assertThat)3 Account (com.google.gerrit.entities.Account)3 GerritJUnit.assertThrows (com.google.gerrit.testing.GerritJUnit.assertThrows)3 Inject (com.google.inject.Inject)3 Config (org.eclipse.jgit.lib.Config)3 PersonIdent (org.eclipse.jgit.lib.PersonIdent)3 ImmutableMap (com.google.common.collect.ImmutableMap)2