38
38
import static org .junit .jupiter .api .Assertions .*;
39
39
40
40
class MailingListArchiveReaderBotTests {
41
- private void addReply (Conversation conversation , MailingList mailingList , PullRequest pr , String reply ) {
41
+ private void addReply (Conversation conversation , EmailAddress recipient , MailingList mailingList , PullRequest pr , String reply ) {
42
42
var first = conversation .first ();
43
43
var references = first .id ().toString ();
44
44
var email = Email .create (EmailAddress .from ("Commenter" , "c@test.test" ), "Re: RFR: " + pr .title (), reply )
45
- .recipient (first . author () )
45
+ .recipient (recipient )
46
46
.id (EmailAddress .from (UUID .randomUUID () + "@id.id" ))
47
47
.header ("In-Reply-To" , first .id ().toString ())
48
48
.header ("References" , references )
49
49
.build ();
50
50
mailingList .post (email );
51
51
}
52
52
53
- private void addReply (Conversation conversation , MailingList mailingList , PullRequest pr ) {
54
- addReply (conversation , mailingList , pr , "Looks good" );
53
+ private void addReply (Conversation conversation , EmailAddress recipient , MailingList mailingList , PullRequest pr ) {
54
+ addReply (conversation , recipient , mailingList , pr , "Looks good" );
55
55
}
56
56
57
57
@ Test
@@ -72,7 +72,7 @@ void simpleArchive(TestInfo testInfo) throws IOException {
72
72
.repo (author )
73
73
.archive (archive )
74
74
.censusRepo (censusBuilder .build ())
75
- .list ( listAddress )
75
+ .lists ( List . of ( new MailingListConfiguration ( listAddress , Set . of ())) )
76
76
.ignoredUsers (Set .of (ignored .forge ().currentUser ().userName ()))
77
77
.listArchive (listServer .getArchive ())
78
78
.smtpServer (listServer .getSMTP ())
@@ -113,7 +113,7 @@ void simpleArchive(TestInfo testInfo) throws IOException {
113
113
// Post a reply directly to the list
114
114
var conversations = mailmanList .conversations (Duration .ofDays (1 ));
115
115
assertEquals (1 , conversations .size ());
116
- addReply (conversations .get (0 ), mailmanList , pr );
116
+ addReply (conversations .get (0 ), listAddress , mailmanList , pr );
117
117
listServer .processIncoming ();
118
118
119
119
// Another archive reader pass - has to be done twice
@@ -147,7 +147,7 @@ void rememberBridged(TestInfo testInfo) throws IOException {
147
147
.repo (author )
148
148
.archive (archive )
149
149
.censusRepo (censusBuilder .build ())
150
- .list ( listAddress )
150
+ .lists ( List . of ( new MailingListConfiguration ( listAddress , Set . of ())) )
151
151
.ignoredUsers (Set .of (ignored .forge ().currentUser ().userName ()))
152
152
.listArchive (listServer .getArchive ())
153
153
.smtpServer (listServer .getSMTP ())
@@ -185,7 +185,7 @@ void rememberBridged(TestInfo testInfo) throws IOException {
185
185
// Post a reply directly to the list
186
186
var conversations = mailmanList .conversations (Duration .ofDays (1 ));
187
187
assertEquals (1 , conversations .size ());
188
- addReply (conversations .get (0 ), mailmanList , pr );
188
+ addReply (conversations .get (0 ), listAddress , mailmanList , pr );
189
189
listServer .processIncoming ();
190
190
191
191
// Another archive reader pass - has to be done twice
@@ -224,7 +224,7 @@ void largeEmail(TestInfo testInfo) throws IOException {
224
224
.repo (author )
225
225
.archive (archive )
226
226
.censusRepo (censusBuilder .build ())
227
- .list ( listAddress )
227
+ .lists ( List . of ( new MailingListConfiguration ( listAddress , Set . of ())) )
228
228
.ignoredUsers (Set .of (ignored .forge ().currentUser ().userName ()))
229
229
.listArchive (listServer .getArchive ())
230
230
.smtpServer (listServer .getSMTP ())
@@ -267,7 +267,7 @@ void largeEmail(TestInfo testInfo) throws IOException {
267
267
assertEquals (1 , conversations .size ());
268
268
269
269
var replyBody = "This line is about 30 bytes long\n " .repeat (1000 * 10 );
270
- addReply (conversations .get (0 ), mailmanList , pr , replyBody );
270
+ addReply (conversations .get (0 ), listAddress , mailmanList , pr , replyBody );
271
271
listServer .processIncoming ();
272
272
273
273
// Another archive reader pass - has to be done twice
1 commit comments
bridgekeeper[bot] commentedon Jun 17, 2020
Review
Issues