diff options
Diffstat (limited to 'tests/integration/incoming_email_test.go')
-rw-r--r-- | tests/integration/incoming_email_test.go | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/tests/integration/incoming_email_test.go b/tests/integration/incoming_email_test.go index 88571303ac..e968a2956e 100644 --- a/tests/integration/incoming_email_test.go +++ b/tests/integration/incoming_email_test.go @@ -19,11 +19,11 @@ import ( "code.gitea.io/gitea/modules/setting" "code.gitea.io/gitea/services/mailer/incoming" incoming_payload "code.gitea.io/gitea/services/mailer/incoming/payload" + sender_service "code.gitea.io/gitea/services/mailer/sender" token_service "code.gitea.io/gitea/services/mailer/token" "code.gitea.io/gitea/tests" "github.com/stretchr/testify/assert" - "gopkg.in/gomail.v2" ) func TestIncomingEmail(t *testing.T) { @@ -189,11 +189,15 @@ func TestIncomingEmail(t *testing.T) { token, err := token_service.CreateToken(token_service.ReplyHandlerType, user, payload) assert.NoError(t, err) - msg := gomail.NewMessage() - msg.SetHeader("To", strings.Replace(setting.IncomingEmail.ReplyToAddress, setting.IncomingEmail.TokenPlaceholder, token, 1)) - msg.SetHeader("From", user.Email) - msg.SetBody("text/plain", token) - err = gomail.Send(&smtpTestSender{}, msg) + msg := sender_service.NewMessageFrom( + strings.Replace(setting.IncomingEmail.ReplyToAddress, setting.IncomingEmail.TokenPlaceholder, token, 1), + "", + user.Email, + "", + token, + ) + + err = sender_service.Send(&smtpTestSender{}, msg) assert.NoError(t, err) assert.Eventually(t, func() bool { |