@@ -93,20 +93,20 @@ func TestComposeIssueCommentMessage(t *testing.T) {
9393	assert .NoError (t , err )
9494	assert .Len (t , msgs , 2 )
9595	gomailMsg  :=  msgs [0 ].ToMessage ()
96- 	replyTo  :=  gomailMsg .GetHeader ("Reply-To" )[0 ]
97- 	subject  :=  gomailMsg .GetHeader ("Subject" )[0 ]
96+ 	replyTo  :=  gomailMsg .GetGenHeader ("Reply-To" )[0 ]
97+ 	subject  :=  gomailMsg .GetGenHeader ("Subject" )[0 ]
9898
99- 	assert .Len (t , gomailMsg .GetHeader ("To" ), 1 , "exactly one recipient is expected in the To field" )
99+ 	assert .Len (t , gomailMsg .GetGenHeader ("To" ), 1 , "exactly one recipient is expected in the To field" )
100100	tokenRegex  :=  regexp .MustCompile (`\Aincoming\+(.+)@localhost\z` )
101101	assert .Regexp (t , tokenRegex , replyTo )
102102	token  :=  tokenRegex .FindAllStringSubmatch (replyTo , 1 )[0 ][1 ]
103103	assert .Equal (t , "Re: " , subject [:4 ], "Comment reply subject should contain Re:" )
104104	assert .Equal (t , "Re: [user2/repo1] @user2 #1 - issue1" , subject )
105- 	assert .Equal (t , "<user2/repo1/issues/1@localhost>" , gomailMsg .GetHeader ("In-Reply-To" )[0 ], "In-Reply-To header doesn't match" )
106- 	assert .ElementsMatch (t , []string {"<user2/repo1/issues/1@localhost>" , "<reply-"  +  token  +  "@localhost>" }, gomailMsg .GetHeader ("References" ), "References header doesn't match" )
107- 	assert .Equal (t , "<user2/repo1/issues/1/comment/2@localhost>" , gomailMsg .GetHeader ("Message-ID" )[0 ], "Message-ID header doesn't match" )
108- 	assert .Equal (t , "<mailto:" + replyTo + ">" , gomailMsg .GetHeader ("List-Post" )[0 ])
109- 	assert .Len (t , gomailMsg .GetHeader ("List-Unsubscribe" ), 2 ) // url + mailto 
105+ 	assert .Equal (t , "<user2/repo1/issues/1@localhost>" , gomailMsg .GetGenHeader ("In-Reply-To" )[0 ], "In-Reply-To header doesn't match" )
106+ 	assert .ElementsMatch (t , []string {"<user2/repo1/issues/1@localhost>" , "<reply-"  +  token  +  "@localhost>" }, gomailMsg .GetGenHeader ("References" ), "References header doesn't match" )
107+ 	assert .Equal (t , "<user2/repo1/issues/1/comment/2@localhost>" , gomailMsg .GetGenHeader ("Message-ID" )[0 ], "Message-ID header doesn't match" )
108+ 	assert .Equal (t , "<mailto:" + replyTo + ">" , gomailMsg .GetGenHeader ("List-Post" )[0 ])
109+ 	assert .Len (t , gomailMsg .GetGenHeader ("List-Unsubscribe" ), 2 ) // url + mailto 
110110
111111	var  buf  bytes.Buffer 
112112	gomailMsg .WriteTo (& buf )
@@ -139,19 +139,19 @@ func TestComposeIssueMessage(t *testing.T) {
139139	assert .Len (t , msgs , 2 )
140140
141141	gomailMsg  :=  msgs [0 ].ToMessage ()
142- 	mailto  :=  gomailMsg .GetHeader ("To" )
143- 	subject  :=  gomailMsg .GetHeader ("Subject" )
144- 	messageID  :=  gomailMsg .GetHeader ("Message-ID" )
145- 	inReplyTo  :=  gomailMsg .GetHeader ("In-Reply-To" )
146- 	references  :=  gomailMsg .GetHeader ("References" )
142+ 	mailto  :=  gomailMsg .GetGenHeader ("To" )
143+ 	subject  :=  gomailMsg .GetGenHeader ("Subject" )
144+ 	messageID  :=  gomailMsg .GetGenHeader ("Message-ID" )
145+ 	inReplyTo  :=  gomailMsg .GetGenHeader ("In-Reply-To" )
146+ 	references  :=  gomailMsg .GetGenHeader ("References" )
147147
148148	assert .Len (t , mailto , 1 , "exactly one recipient is expected in the To field" )
149149	assert .Equal (t , "[user2/repo1] @user2 #1 - issue1" , subject [0 ])
150150	assert .Equal (t , "<user2/repo1/issues/1@localhost>" , inReplyTo [0 ], "In-Reply-To header doesn't match" )
151151	assert .Equal (t , "<user2/repo1/issues/1@localhost>" , references [0 ], "References header doesn't match" )
152152	assert .Equal (t , "<user2/repo1/issues/1@localhost>" , messageID [0 ], "Message-ID header doesn't match" )
153- 	assert .Empty (t , gomailMsg .GetHeader ("List-Post" ))         // incoming mail feature disabled 
154- 	assert .Len (t , gomailMsg .GetHeader ("List-Unsubscribe" ), 1 ) // url without mailto 
153+ 	assert .Empty (t , gomailMsg .GetGenHeader ("List-Post" ))         // incoming mail feature disabled 
154+ 	assert .Len (t , gomailMsg .GetGenHeader ("List-Unsubscribe" ), 1 ) // url without mailto 
155155}
156156
157157func  TestTemplateSelection (t  * testing.T ) {
@@ -169,7 +169,7 @@ func TestTemplateSelection(t *testing.T) {
169169	template .Must (bodyTemplates .New ("issue/close" ).Parse ("issue/close/body" ))
170170
171171	expect  :=  func (t  * testing.T , msg  * sender_service.Message , expSubject , expBody  string ) {
172- 		subject  :=  msg .ToMessage ().GetHeader ("Subject" )
172+ 		subject  :=  msg .ToMessage ().GetGenHeader ("Subject" )
173173		msgbuf  :=  new (bytes.Buffer )
174174		_ , _  =  msg .ToMessage ().WriteTo (msgbuf )
175175		wholemsg  :=  msgbuf .String ()
@@ -225,7 +225,7 @@ func TestTemplateServices(t *testing.T) {
225225			Content : "test body" , Comment : comment ,
226226		}, recipients , fromMention , "TestTemplateServices" )
227227
228- 		subject  :=  msg .ToMessage ().GetHeader ("Subject" )
228+ 		subject  :=  msg .ToMessage ().GetGenHeader ("Subject" )
229229		msgbuf  :=  new (bytes.Buffer )
230230		_ , _  =  msg .ToMessage ().WriteTo (msgbuf )
231231		wholemsg  :=  msgbuf .String ()
0 commit comments