当前位置: 首页>>代码示例>>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;未经允许,请勿转载。