當前位置: 首頁>>代碼示例>>Java>>正文


Java Recipient類代碼示例

本文整理匯總了Java中br.org.owail.sender.email.Recipient的典型用法代碼示例。如果您正苦於以下問題:Java Recipient類的具體用法?Java Recipient怎麽用?Java Recipient使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


Recipient類屬於br.org.owail.sender.email包,在下文中一共展示了Recipient類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: sendSystemInstallationEmail_method_should_send_an_SystemInstallationEmail

import br.org.owail.sender.email.Recipient; //導入依賴的package包/類
@Test
public void sendSystemInstallationEmail_method_should_send_an_SystemInstallationEmail() throws Exception {
    whenNew(BasicEmailSender.class).withNoArguments().thenReturn(emailSender);
    when(emailSender.getPassword()).thenReturn(PASSWORD);
    when(initializationData.getEmailSender()).thenReturn(emailSenderDto);

    whenNew(Sender.class).withArguments(Mockito.anyString(), Mockito.anyString(), Mockito.anyString()).thenReturn(sender);

    mockStatic(Recipient.class);
    when(Recipient.createTO(Mockito.anyString(), Mockito.anyString())).thenReturn(recipient);

    mockStatic(OtusEmailFactory.class);
    when(OtusEmailFactory.createSystemInstallationEmail(sender, recipient)).thenReturn(installationEmail);

    service.sendSystemInstallationEmail(initializationData);

    verifyStatic();
    OtusEmailFactory.createSystemInstallationEmail(sender, recipient);
}
 
開發者ID:ccem-dev,項目名稱:otus-api,代碼行數:20,代碼來源:EmailNotifierServiceTest.java

示例2: method_create_should_send_email

import br.org.owail.sender.email.Recipient; //導入依賴的package包/類
@Test
public void method_create_should_send_email() throws Exception {
    PowerMockito.mockStatic(Recipient.class);
    PowerMockito.mockStatic(OtusEmailFactory.class);
    PowerMockito.whenNew(User.class).withNoArguments().thenReturn(user);

    Mockito.when(emailNotifierService.getSender()).thenReturn(sender);
    Mockito.when(userDao.findAdmin()).thenReturn(user);
    Mockito.when(user.getEmail()).thenReturn(EMAIL);
    Mockito.when(user.getName()).thenReturn(NAME);
    Mockito.when(Recipient.createTO(NAME, EMAIL)).thenReturn(recipient);
    Mockito.when(OtusEmailFactory.createNewUserGreetingsEmail(sender, recipient)).thenReturn(newUserGreetingsEmail);
    Mockito.when(OtusEmailFactory.createNewUserNotificationEmail(sender, recipient, user)).thenReturn(newUserNotificationEmail);
    Mockito.when(managementUserService.isUnique(EMAIL)).thenReturn(Boolean.TRUE);
    Mockito.when(signupDataDto.getEmail()).thenReturn(EMAIL);
    Mockito.when(signupDataDto.isValid()).thenReturn(Boolean.TRUE);

    signupServiceBean.create(signupDataDto);
    Mockito.verify(emailNotifierService).sendEmailSync(newUserGreetingsEmail);
    Mockito.verify(emailNotifierService).sendEmailSync(newUserNotificationEmail);
}
 
開發者ID:ccem-dev,項目名稱:otus-api,代碼行數:22,代碼來源:SignupServiceTest.java

示例3: main

import br.org.owail.sender.email.Recipient; //導入依賴的package包/類
public static void main(String[] args) {
Mailer mailer = Mailer.createTLSMailer(new MyCustomSMTPSessionProps());

/* Configure email sender */
mailer.setFrom(new Sender("Sender Name", "account.user", "the_password"));

/* Configure email recipients */
mailer.addRecipient(Recipient.createTO("Recipient TO", "[email protected]")); 	// main
mailer.addRecipient(Recipient.createCC("Recipient CC", "[email protected]")); 	// carbon copy
mailer.addRecipient(Recipient.createBCC("Recipient BCC", "[email protected]")); 	// blind carbon copy

/* Configure the email message */
mailer.setSubject("Simple Gmail Test!");
mailer.setContent("This is the message body.");

try {
    mailer.send();
} catch (Exception e) {
    System.out.println("Oh no...");
}
   }
 
開發者ID:ccem-dev,項目名稱:owail,代碼行數:22,代碼來源:CustomSending.java

示例4: main

import br.org.owail.sender.email.Recipient; //導入依賴的package包/類
public static void main(String[] args) {
GMailer mailer = GMailer.createTLSMailer();

/* Configure email sender */
mailer.setFrom(new Sender("Sender Name", "gmail.account.user", "the_password"));

/* Configure email recipients */
mailer.addRecipient(Recipient.createTO("Recipient TO", "[email protected]")); 	// main
mailer.addRecipient(Recipient.createCC("Recipient CC", "[email protected]")); 	// carbon copy
mailer.addRecipient(Recipient.createBCC("Recipient BCC", "[email protected]")); 	// blind carbon copy

/* Configure the email message */
mailer.setSubject("Simple Gmail Test!");
mailer.setContent("This is the message body.");

try {
    mailer.send();
} catch (Exception e) {
    System.out.println("Oh no...");
}
   }
 
開發者ID:ccem-dev,項目名稱:owail,代碼行數:22,代碼來源:SimpleGmail.java

示例5: sendSystemInstallationEmail

import br.org.owail.sender.email.Recipient; //導入依賴的package包/類
@Override
public void sendSystemInstallationEmail(OtusInitializationConfigDto initializationData) throws EmailNotificationException, EncryptedException {
    BasicEmailSender emailSenderDto = new BasicEmailSender();
    Equalizer.equalize(initializationData.getEmailSender(), emailSenderDto);
    Recipient recipient = Recipient.createTO(initializationData.getUser().getName(), initializationData.getUser().getEmail());
    Sender sender = new Sender(emailSenderDto.getName(), emailSenderDto.getEmail(), EncryptorResources.decrypt(emailSenderDto.getPassword()));
    SystemInstallationEmail email = OtusEmailFactory.createSystemInstallationEmail(sender, recipient);
    sendEmail(email);
}
 
開發者ID:ccem-dev,項目名稱:otus-api,代碼行數:10,代碼來源:EmailNotifierServiceBean.java

示例6: spy

import br.org.owail.sender.email.Recipient; //導入依賴的package包/類
@Ignore // atualização do powerMock para 1.7.3
@Test
public void method_create_with_signupDataDtoValid_and_managementUserServiceUnique_should_verify_evocation_internal_methods()
		throws Exception {
	when(signupDataDto.isValid()).thenReturn(POSITIVE_ANSWER);
	when(managementUserService.isUnique(anyString())).thenReturn(POSITIVE_ANSWER);
	mockStatic(Equalizer.class);

	sender = spy(new Sender(NAME, EMAIL, PASSWORD));
	when(emailNotifierService.getSender()).thenReturn(sender);
	when(user.getName()).thenReturn(NAME);
	when(user.getEmail()).thenReturn(EMAIL);
	mockStatic(Recipient.class);

	systemAdministrator = spy(new User());
	when(userDao.findAdmin()).thenReturn(systemAdministrator);
	when(systemAdministrator.getName()).thenReturn(NAME);
	when(systemAdministrator.getEmail()).thenReturn(EMAIL);
	mockStatic(OtusEmailFactory.class);

	signupServiceBean.create(signupDataDto);
	verifyNew(User.class, times(2)).withNoArguments();
	verifyStatic(times(1));
	Equalizer.equalize(signupDataDto, user);
	verify(emailNotifierService).getSender();
	verifyPrivate(signupServiceBean).invoke("sendEmailToUser", user, sender);
	verifyPrivate(signupServiceBean).invoke("sendEmailToAdmin", sender, user);
	verify(userDao).persist(user);

}
 
開發者ID:ccem-dev,項目名稱:otus-api,代碼行數:31,代碼來源:SignupServiceBeanTest.java

示例7: constructRecipientList

import br.org.owail.sender.email.Recipient; //導入依賴的package包/類
private List<Recipient> constructRecipientList() {
recipients = new ArrayList<Recipient>();

recipient = Recipient.createTO("Recipient", "[email protected]");

recipients.add(recipient);
return recipients;
   }
 
開發者ID:ccem-dev,項目名稱:owail,代碼行數:9,代碼來源:GMailerTest.java

示例8: createSystemInstallationEmail

import br.org.owail.sender.email.Recipient; //導入依賴的package包/類
public static SystemInstallationEmail createSystemInstallationEmail(Sender sender, Recipient recipient) {
    SystemInstallationEmail email = new SystemInstallationEmail(sender, recipient);
    email.setFrom(sender);

    return email;
}
 
開發者ID:ccem-dev,項目名稱:otus-api,代碼行數:7,代碼來源:OtusEmailFactory.java

示例9: createNewUserGreetingsEmail

import br.org.owail.sender.email.Recipient; //導入依賴的package包/類
public static NewUserGreetingsEmail createNewUserGreetingsEmail(Sender sender, Recipient recipient) {
    NewUserGreetingsEmail email = new NewUserGreetingsEmail(recipient);
    email.setFrom(sender);

    return email;
}
 
開發者ID:ccem-dev,項目名稱:otus-api,代碼行數:7,代碼來源:OtusEmailFactory.java

示例10: createNewUserNotificationEmail

import br.org.owail.sender.email.Recipient; //導入依賴的package包/類
public static NewUserNotificationEmail createNewUserNotificationEmail(Sender sender, Recipient recipient, User user) {
    NewUserNotificationEmail email = new NewUserNotificationEmail(sender, recipient, user);
    email.setFrom(sender);

    return email;
}
 
開發者ID:ccem-dev,項目名稱:otus-api,代碼行數:7,代碼來源:OtusEmailFactory.java

示例11: NewUserGreetingsEmail

import br.org.owail.sender.email.Recipient; //導入依賴的package包/類
public NewUserGreetingsEmail(Recipient recipient) {
    buildDataMap(recipient);
    defineSubject(recipient.getName());
    defineRecipient(recipient.getEmailAddress());
}
 
開發者ID:ccem-dev,項目名稱:otus-api,代碼行數:6,代碼來源:NewUserGreetingsEmail.java

示例12: buildDataMap

import br.org.owail.sender.email.Recipient; //導入依賴的package包/類
private void buildDataMap(Recipient recipient) {
    dataMap = new HashMap<String, String>();
    dataMap.put("name", recipient.getName());
}
 
開發者ID:ccem-dev,項目名稱:otus-api,代碼行數:5,代碼來源:NewUserGreetingsEmail.java

示例13: NewUserNotificationEmail

import br.org.owail.sender.email.Recipient; //導入依賴的package包/類
public NewUserNotificationEmail(Sender sender, Recipient recipient, User user) {
    buildDataMap(user);
    defineSubject();
    defineRecipient(recipient.getEmailAddress());
}
 
開發者ID:ccem-dev,項目名稱:otus-api,代碼行數:6,代碼來源:NewUserNotificationEmail.java

示例14: SystemInstallationEmail

import br.org.owail.sender.email.Recipient; //導入依賴的package包/類
public SystemInstallationEmail(Sender sender, Recipient recipient) {
    buildDataMap();
    defineSubject();
    defineRecipient(recipient.getEmailAddress());
}
 
開發者ID:ccem-dev,項目名稱:otus-api,代碼行數:6,代碼來源:SystemInstallationEmail.java

示例15: sendEmailToUser

import br.org.owail.sender.email.Recipient; //導入依賴的package包/類
private void sendEmailToUser(User user, Sender sender) throws EmailNotificationException {
    Recipient recipient = Recipient.createTO(user.getName(), user.getEmail());
    NewUserGreetingsEmail email = OtusEmailFactory.createNewUserGreetingsEmail(sender, recipient);
    emailNotifierService.sendEmailSync(email);
}
 
開發者ID:ccem-dev,項目名稱:otus-api,代碼行數:6,代碼來源:SignupServiceBean.java


注:本文中的br.org.owail.sender.email.Recipient類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。