@Test public void noreply_set_is_also_in_message() { when(mockedConfiguration.getEmailReplyTo()).thenReturn("reply1"); SimpleMailMessage message = factoryToTest.createMessage("subject1"); assertEquals("reply1", message.getReplyTo()); }
public SimpleMailMessage createMessage(String subject) { String emailReplyTo = configuration.getEmailReplyTo(); SimpleMailMessage message = new SimpleMailMessage(); message.setFrom(configuration.getEmailFrom()); if (isEmpty(emailReplyTo)) { message.setReplyTo(emailReplyTo); } message.setSubject(subject); message.setSentDate(new Date()); return message; }
MailMessageFactory { public SimpleMailMessage createMessage(String subject) { String emailReplyTo = configuration.getEmailReplyTo(); SimpleMailMessage message = new SimpleMailMessage(); message.setFrom(configuration.getEmailFrom()); if (isEmpty(emailReplyTo)) { message.setReplyTo(emailReplyTo); } message.setSubject(subject); message.setSentDate(new Date()); return message; } }
MailMessageFactory { public SimpleMailMessage createMessage(String subject) { String emailReplyTo = configuration.getEmailReplyTo(); SimpleMailMessage message = new SimpleMailMessage(); message.setFrom(configuration.getEmailFrom()); if (isEmpty(emailReplyTo)) { message.setReplyTo(emailReplyTo); } message.setSubject(subject); message.setSentDate(new Date()); return message; }  }
MailMessageFactory { public SimpleMailMessage createMessage(String subject) { String emailReplyTo = configuration.getEmailReplyTo(); SimpleMailMessage message = new SimpleMailMessage(); message.setFrom(configuration.getEmailFrom()); if (isEmpty(emailReplyTo)) { message.setReplyTo(emailReplyTo); } message.setSubject(subject); message.setSentDate(new Date()); return message; }  SimpleMailMessage createMessage(String subject); }
MailMessageFactory { public SimpleMailMessage createMessage(String subject) { String emailReplyTo = configuration.getEmailReplyTo(); SimpleMailMessage message = new SimpleMailMessage(); message.setFrom(configuration.getEmailFrom()); if (isEmpty(emailReplyTo)) { message.setReplyTo(emailReplyTo); } message.setSubject(subject); message.setSentDate(new Date()); return message; }  SimpleMailMessage createMessage(String subject);  }