Search in sources :

Example 61 with TestAccount

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

the class ChangeNotificationsIT method addReviewerToReviewableChangeNotifyOwnerReviewers.

private void addReviewerToReviewableChangeNotifyOwnerReviewers(Adder adder) throws Exception {
    StagedChange sc = stageReviewableChange();
    TestAccount reviewer = accountCreator.create("added", "added@example.com", "added", null);
    addReviewer(adder, sc.changeId, sc.owner, reviewer.email(), OWNER_REVIEWERS);
    // TODO(logan): Should CCs be included?
    assertThat(sender).sent("newchange", sc).to(reviewer).cc(sc.reviewer).cc(StagedUsers.REVIEWER_BY_EMAIL, StagedUsers.CC_BY_EMAIL).noOneElse();
    assertThat(sender).didNotSend();
}
Also used : TestAccount(com.google.gerrit.acceptance.TestAccount)

Example 62 with TestAccount

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

the class ChangeNotificationsIT method addReviewerToReviewableWipChangeSingly.

@Test
public void addReviewerToReviewableWipChangeSingly() throws Exception {
    StagedChange sc = stageReviewableWipChange();
    TestAccount reviewer = accountCreator.create("added", "added@example.com", "added", null);
    addReviewer(singly(), sc.changeId, sc.owner, reviewer.email());
    // TODO(dborowitz): In theory this should match the batch case, but we don't currently pass
    // enough info into ModifyReviewersEmail#emailReviewers to distinguish the reviewStarted case.
    // Complicating the emailReviewers arguments is not the answer; this needs to be rewritten.
    // Tolerate the difference for now.
    assertThat(sender).didNotSend();
}
Also used : TestAccount(com.google.gerrit.acceptance.TestAccount) AbstractNotificationTest(com.google.gerrit.acceptance.AbstractNotificationTest) Test(org.junit.Test)

Example 63 with TestAccount

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

the class ChangeNotificationsIT method commentOnReviewableChangeByBot.

@Test
public void commentOnReviewableChangeByBot() throws Exception {
    StagedChange sc = stageReviewableChange();
    TestAccount bot = sc.testAccount("bot");
    review(bot, sc.changeId, ENABLED, null, "autogenerated:bot");
    assertThat(sender).sent("comment", sc).to(sc.owner).cc(sc.reviewer, sc.ccer).cc(StagedUsers.REVIEWER_BY_EMAIL, StagedUsers.CC_BY_EMAIL).noOneElse();
    assertThat(sender).didNotSend();
}
Also used : TestAccount(com.google.gerrit.acceptance.TestAccount) AbstractNotificationTest(com.google.gerrit.acceptance.AbstractNotificationTest) Test(org.junit.Test)

Example 64 with TestAccount

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

the class ChangeNotificationsIT method commentOnReviewableWipChangeByBot.

@Test
public void commentOnReviewableWipChangeByBot() throws Exception {
    StagedChange sc = stageReviewableWipChange();
    TestAccount bot = sc.testAccount("bot");
    review(bot, sc.changeId, ENABLED, null, "autogenerated:tag");
    assertThat(sender).sent("comment", sc).to(sc.owner).noOneElse();
    assertThat(sender).didNotSend();
}
Also used : TestAccount(com.google.gerrit.acceptance.TestAccount) AbstractNotificationTest(com.google.gerrit.acceptance.AbstractNotificationTest) Test(org.junit.Test)

Example 65 with TestAccount

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

the class ChangeNotificationsIT method addReviewerToReviewableChange.

/*
   * ModifyReviewerSender tests (only for additions).
   */
private void addReviewerToReviewableChange(Adder adder) throws Exception {
    StagedChange sc = stageReviewableChange();
    TestAccount reviewer = accountCreator.create("added", "added@example.com", "added", null);
    addReviewer(adder, sc.changeId, sc.owner, reviewer.email());
    // TODO(logan): Should CCs be included?
    assertThat(sender).sent("newchange", sc).to(reviewer).cc(sc.reviewer).cc(StagedUsers.REVIEWER_BY_EMAIL, StagedUsers.CC_BY_EMAIL).noOneElse();
    assertThat(sender).didNotSend();
}
Also used : TestAccount(com.google.gerrit.acceptance.TestAccount)

Aggregations

TestAccount (com.google.gerrit.acceptance.TestAccount)137 Test (org.junit.Test)122 AbstractDaemonTest (com.google.gerrit.acceptance.AbstractDaemonTest)106 PushOneCommit (com.google.gerrit.acceptance.PushOneCommit)54 ReviewInput (com.google.gerrit.extensions.api.changes.ReviewInput)19 AbstractNotificationTest (com.google.gerrit.acceptance.AbstractNotificationTest)15 PublicKeyStore.keyToString (com.google.gerrit.gpg.PublicKeyStore.keyToString)14 Registration (com.google.gerrit.acceptance.ExtensionRegistry.Registration)13 ArrayList (java.util.ArrayList)13 InMemoryRepository (org.eclipse.jgit.internal.storage.dfs.InMemoryRepository)12 AccountIndexedCounter (com.google.gerrit.acceptance.AccountIndexedCounter)10 ReviewerInput (com.google.gerrit.extensions.api.changes.ReviewerInput)10 AccountInfo (com.google.gerrit.extensions.common.AccountInfo)10 Message (com.google.gerrit.testing.FakeEmailSender.Message)10 GerritConfig (com.google.gerrit.acceptance.config.GerritConfig)9 EmailInput (com.google.gerrit.extensions.api.accounts.EmailInput)9 ChangeInfo (com.google.gerrit.extensions.common.ChangeInfo)9 AuthException (com.google.gerrit.extensions.restapi.AuthException)9 AttentionSetUpdate (com.google.gerrit.entities.AttentionSetUpdate)8 Change (com.google.gerrit.entities.Change)8