use of jakarta.mail.Provider in project spring-boot by spring-projects.
the class MailHealthIndicatorTests method setup.
@BeforeEach
void setup() {
Session session = Session.getDefaultInstance(new Properties());
session.addProvider(new Provider(Type.TRANSPORT, "success", SuccessTransport.class.getName(), "Test", "1.0.0"));
this.mailSender = mock(JavaMailSenderImpl.class);
given(this.mailSender.getHost()).willReturn("smtp.acme.org");
given(this.mailSender.getPort()).willReturn(25);
given(this.mailSender.getSession()).willReturn(session);
this.indicator = new MailHealthIndicator(this.mailSender);
}
Aggregations