### Question:
SmtpNotificationSender extends NotificationSender { @Override public void sendEmailWithAttachments(EmailWithAttachmentsDTO in, Authentication authentication, String userId) throws Exception { AcmUser user = getUserDao().findByUserId(userId); sendEmailWithAttachments(in, authentication, user); }  @Override void sendPlainEmail(Stream<T> emailsDataStream, EmailBuilder<T> emailBuilder, EmailBodyBuilder<T> emailBodyBuilder); @Override void sendEmailWithAttachments(EmailWithAttachmentsDTO in, Authentication authentication, String userId); @Override void sendEmailWithAttachments(EmailWithAttachmentsDTO in, Authentication authentication, AcmUser user); @Override void sendEmailWithAttachmentsAndLinks(EmailWithAttachmentsAndLinksDTO in, Authentication authentication, AcmUser user); @Override List<EmailWithEmbeddedLinksResultDTO> sendEmailWithEmbeddedLinks(EmailWithEmbeddedLinksDTO in, Authentication authentication,
            AcmUser user);  }### Answer:
@Test public void testSendEmailWithAttachments_withAcmUser() throws MuleException, AcmEncryptionException, Exception { Capture<String> templateCapture = EasyMock.newCapture(); mockEmailWithAttachmentsDTO.setTemplate(capture(templateCapture)); expect(mockEmailWithAttachmentsDTO.getTemplate()).andReturn(null); mockSmtpService.sendEmailWithAttachments(mockEmailWithAttachmentsDTO, mockAuthentication, mockAcmUser); expectLastCall(); replayAll(); smtpNotificationSender.sendEmailWithAttachments(mockEmailWithAttachmentsDTO, mockAuthentication, mockAcmUser); verifyAll(); }
@Test public void testSendEmailWithAttachments_withUserId() throws MuleException, AcmEncryptionException, Exception { expect(mockUserDao.findByUserId("email_user_value")).andReturn(mockAcmUser); Capture<String> templateCapture = EasyMock.newCapture(); mockEmailWithAttachmentsDTO.setTemplate(capture(templateCapture)); expect(mockEmailWithAttachmentsDTO.getTemplate()).andReturn(null); mockSmtpService.sendEmailWithAttachments(mockEmailWithAttachmentsDTO, mockAuthentication, mockAcmUser); expectLastCall(); replayAll(); smtpNotificationSender.sendEmailWithAttachments(mockEmailWithAttachmentsDTO, mockAuthentication, "email_user_value"); verifyAll(); }