Java – how to test e-mail logic using play framework

I found an extended mailer course and wanted to test it automatically

Using a mock mail program, I can send mail to the console, but how do I test mail logic from automated tests?

(is there anything like mailer testing with rails?)

br,Touko

Solution

When writing this question, I found this link: testing mail sending by using mock mailer

Therefore, you can use play libs. Mail. Mock accesses messages mailed using the mock mail program, as follows:

String email = Mail.Mock.getLastMessageReceivedBy("joe@example.com");

Mail is returned as a string, but it's better than nothing

Although share this, because it took me a while to find this

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>