Search in sources :

Example 16 with GerritConfig

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

the class ListMailFilterIT method listFilterOff.

@Test
@GerritConfig(name = "receiveemail.filter.mode", value = "OFF")
public void listFilterOff() throws Exception {
    ChangeInfo changeInfo = createChangeAndReplyByEmail();
    // Check that the comments from the email have been persisted
    Collection<ChangeMessageInfo> messages = gApi.changes().id(changeInfo.id).get().messages;
    assertThat(messages).hasSize(3);
}
Also used : ChangeInfo(com.google.gerrit.extensions.common.ChangeInfo) ChangeMessageInfo(com.google.gerrit.extensions.common.ChangeMessageInfo) GerritConfig(com.google.gerrit.acceptance.GerritConfig) Test(org.junit.Test)

Example 17 with GerritConfig

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

the class ListMailFilterIT method listFilterWhitelistFiltersNotListedUser.

@Test
@GerritConfig(name = "receiveemail.filter.mode", value = "WHITELIST")
@GerritConfig(name = "receiveemail.filter.patterns", values = { ".+@gerritcodereview\\.com", "a@b\\.com" })
public void listFilterWhitelistFiltersNotListedUser() throws Exception {
    ChangeInfo changeInfo = createChangeAndReplyByEmail();
    // Check that the comments from the email have NOT been persisted
    Collection<ChangeMessageInfo> messages = gApi.changes().id(changeInfo.id).get().messages;
    assertThat(messages).hasSize(2);
}
Also used : ChangeInfo(com.google.gerrit.extensions.common.ChangeInfo) ChangeMessageInfo(com.google.gerrit.extensions.common.ChangeMessageInfo) GerritConfig(com.google.gerrit.acceptance.GerritConfig) Test(org.junit.Test)

Example 18 with GerritConfig

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

the class ListMailFilterIT method listFilterWhitelistDoesNotFilterListedUser.

@Test
@GerritConfig(name = "receiveemail.filter.mode", value = "WHITELIST")
@GerritConfig(name = "receiveemail.filter.patterns", values = { ".+ser@example\\.com", "a@b\\.com" })
public void listFilterWhitelistDoesNotFilterListedUser() throws Exception {
    ChangeInfo changeInfo = createChangeAndReplyByEmail();
    // Check that the comments from the email have been persisted
    Collection<ChangeMessageInfo> messages = gApi.changes().id(changeInfo.id).get().messages;
    assertThat(messages).hasSize(3);
}
Also used : ChangeInfo(com.google.gerrit.extensions.common.ChangeInfo) ChangeMessageInfo(com.google.gerrit.extensions.common.ChangeMessageInfo) GerritConfig(com.google.gerrit.acceptance.GerritConfig) Test(org.junit.Test)

Example 19 with GerritConfig

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

the class ListMailFilterIT method listFilterBlacklistDoesNotFilterNotListedUser.

@Test
@GerritConfig(name = "receiveemail.filter.mode", value = "BLACKLIST")
@GerritConfig(name = "receiveemail.filter.patterns", values = { ".+@gerritcodereview\\.com", "a@b\\.com" })
public void listFilterBlacklistDoesNotFilterNotListedUser() throws Exception {
    ChangeInfo changeInfo = createChangeAndReplyByEmail();
    // Check that the comments from the email have been persisted
    Collection<ChangeMessageInfo> messages = gApi.changes().id(changeInfo.id).get().messages;
    assertThat(messages).hasSize(3);
}
Also used : ChangeInfo(com.google.gerrit.extensions.common.ChangeInfo) ChangeMessageInfo(com.google.gerrit.extensions.common.ChangeMessageInfo) GerritConfig(com.google.gerrit.acceptance.GerritConfig) Test(org.junit.Test)

Aggregations

GerritConfig (com.google.gerrit.acceptance.GerritConfig)19 Test (org.junit.Test)19 AbstractDaemonTest (com.google.gerrit.acceptance.AbstractDaemonTest)12 ChangeInfo (com.google.gerrit.extensions.common.ChangeInfo)6 ChangeMessageInfo (com.google.gerrit.extensions.common.ChangeMessageInfo)5 PushOneCommit (com.google.gerrit.acceptance.PushOneCommit)4 ReviewInput (com.google.gerrit.extensions.api.changes.ReviewInput)3 ObjectId (org.eclipse.jgit.lib.ObjectId)3 ServerInfo (com.google.gerrit.extensions.common.ServerInfo)2 SuggestedReviewerInfo (com.google.gerrit.extensions.common.SuggestedReviewerInfo)2 ChangeData (com.google.gerrit.server.query.change.ChangeData)2 RevCommit (org.eclipse.jgit.revwalk.RevCommit)2 RestResponse (com.google.gerrit.acceptance.RestResponse)1 TestAccount (com.google.gerrit.acceptance.TestAccount)1 UseSsh (com.google.gerrit.acceptance.UseSsh)1 GroupAssert.assertGroupInfo (com.google.gerrit.acceptance.api.group.GroupAssert.assertGroupInfo)1 GroupReference (com.google.gerrit.common.data.GroupReference)1 RobotCommentInput (com.google.gerrit.extensions.api.changes.ReviewInput.RobotCommentInput)1 RevisionApi (com.google.gerrit.extensions.api.changes.RevisionApi)1 SubmitInput (com.google.gerrit.extensions.api.changes.SubmitInput)1