How to test JavaMailSender?
https://www.thetopsites.net/article/54836864.shtmlHow to test JavaMailSender?, I think you are getting unit test / mocking wrong. It seems that you want to create a unit test; but expect the results of a integration test. What you A JavaMailSender client is not as easy to test as a plain MailSender client, but still straightforward compared to traditional JavaMail code: Just let createMimeMessage return a plain MimeMessage created …