@Test void testSendMultipleMails() throws Exception { AmazonSimpleEmailService emailService = mock(AmazonSimpleEmailService.class); SimpleEmailServiceMailSender mailSender = new SimpleEmailServiceMailSender( emailService); ArgumentCaptor<SendEmailRequest> request = ArgumentCaptor .forClass(SendEmailRequest.class); when(emailService.sendEmail(request.capture())) .thenReturn(new SendEmailResult().withMessageId("123")); mailSender.send(createSimpleMailMessage(), createSimpleMailMessage()); verify(emailService, times(2)) .sendEmail(ArgumentMatchers.any(SendEmailRequest.class)); }
@Override public void send(SimpleMailMessage simpleMailMessage) throws MailException { send(new SimpleMailMessage[] { simpleMailMessage }); }
SimpleEmailServiceMailSender implements MailSender, DisposableBean { @Override public void send(SimpleMailMessage simpleMailMessage) throws MailException { send(new SimpleMailMessage[] { simpleMailMessage }); } }
SimpleEmailServiceMailSender implements MailSender, DisposableBean { @Override public void send(SimpleMailMessage simpleMailMessage) throws MailException { send(new SimpleMailMessage[] { simpleMailMessage }); } SimpleEmailServiceMailSender(
			AmazonSimpleEmailService amazonSimpleEmailService); }
SimpleEmailServiceMailSender implements MailSender, DisposableBean { @Override public void send(SimpleMailMessage simpleMailMessage) throws MailException { send(new SimpleMailMessage[] { simpleMailMessage }); } SimpleEmailServiceMailSender(
			AmazonSimpleEmailService amazonSimpleEmailService); @Override void send(SimpleMailMessage simpleMailMessage); @SuppressWarnings("OverloadedVarargsMethod") @Override void send(SimpleMailMessage... simpleMailMessages); @Override final void destroy(); }
SimpleEmailServiceMailSender implements MailSender, DisposableBean { @Override public void send(SimpleMailMessage simpleMailMessage) throws MailException { send(new SimpleMailMessage[] { simpleMailMessage }); } SimpleEmailServiceMailSender(
			AmazonSimpleEmailService amazonSimpleEmailService); @Override void send(SimpleMailMessage simpleMailMessage); @SuppressWarnings("OverloadedVarargsMethod") @Override void send(SimpleMailMessage... simpleMailMessages); @Override final void destroy();  }