use of org.springframework.cloud.service.common.SmtpServiceInfo in project spring-cloud-connectors by spring-cloud.
the class CloudFoundryConnectorSmtpServiceTest method smtpServiceCreation.
@Test
public void smtpServiceCreation() {
when(mockEnvironment.getEnvValue("VCAP_SERVICES")).thenReturn(getServicesPayload(getSmtpServicePayload("smtp-1", hostname, username, password)));
List<ServiceInfo> serviceInfos = testCloudConnector.getServiceInfos();
SmtpServiceInfo smtpServiceInfo = (SmtpServiceInfo) getServiceInfo(serviceInfos, "smtp-1");
assertNotNull(smtpServiceInfo);
assertEquals(hostname, smtpServiceInfo.getHost());
assertEquals(587, smtpServiceInfo.getPort());
assertEquals(username, smtpServiceInfo.getUserName());
assertEquals(password, smtpServiceInfo.getPassword());
}
use of org.springframework.cloud.service.common.SmtpServiceInfo in project spring-cloud-connectors by spring-cloud.
the class SmtpServiceConnectorCreatorTest method cloudMailSenderCreation.
@Test
public void cloudMailSenderCreation() throws Exception {
SmtpServiceInfo serviceInfo = createServiceInfo();
MailSender dataSource = testCreator.create(serviceInfo, null);
assertConnectorProperties(serviceInfo, dataSource);
}
use of org.springframework.cloud.service.common.SmtpServiceInfo in project spring-cloud-connectors by spring-cloud.
the class CloudFoundryConnectorSmtpServiceTest method smtpServiceCreationWithUri.
@Test
public void smtpServiceCreationWithUri() {
when(mockEnvironment.getEnvValue("VCAP_SERVICES")).thenReturn(getServicesPayload(getSmtpServicePayloadWithUri("smtp-1", hostname, port, username, password)));
List<ServiceInfo> serviceInfos = testCloudConnector.getServiceInfos();
SmtpServiceInfo smtpServiceInfo = (SmtpServiceInfo) getServiceInfo(serviceInfos, "smtp-1");
assertNotNull(smtpServiceInfo);
assertEquals(hostname, smtpServiceInfo.getHost());
assertEquals(port, smtpServiceInfo.getPort());
assertEquals(username, smtpServiceInfo.getUserName());
assertEquals(password, smtpServiceInfo.getPassword());
}
Aggregations