Search in sources :

Example 1 with ConnectEmcEmail

use of com.emc.vipr.model.sys.eventhandler.ConnectEmcEmail in project coprhd-controller by CoprHD.

the class ConfigServiceTest method testInvalidTlsValue.

@Test
public void testInvalidTlsValue() {
    ConnectEmcEmail email = new ConnectEmcEmail();
    email.setEmailSender("DONOTREPLY@customer.com");
    email.setEmailServer("mailhub.lss.emc.com");
    email.setNotifyEmailAddress("joe.customer@customer.com");
    email.setPrimaryEmailAddress("emailalertesg@emc.com");
    email.setSafeEncryption("no");
    email.setUserName("root");
    email.setPassword("ChangeMe");
    email.setStartTls("Maybe");
}
Also used : ConnectEmcEmail(com.emc.vipr.model.sys.eventhandler.ConnectEmcEmail) Test(org.junit.Test)

Example 2 with ConnectEmcEmail

use of com.emc.vipr.model.sys.eventhandler.ConnectEmcEmail in project coprhd-controller by CoprHD.

the class ConfigServiceTest method testEmailUsingAuth.

@Test
public void testEmailUsingAuth() {
    ConnectEmcEmail email = new ConnectEmcEmail();
    email.setEmailSender("DONOTREPLY@customer.com");
    email.setEmailServer("mailhub.lss.emc.com");
    email.setNotifyEmailAddress("joe.customer@customer.com");
    email.setPrimaryEmailAddress("emailalertesg@emc.com");
    email.setSafeEncryption("no");
    email.setUserName("root");
    email.setPassword("ChangeMe");
    try {
        email.setSmtpAuthType("login");
    } catch (Exception e) {
        Assert.fail();
    }
    PropertyInfoUpdate propInfo = ConfigService.ConfigureConnectEmc.configureEmail(email);
    Assert.assertEquals(propInfo.getProperty("system_connectemc_smtp_server"), email.getEmailServer());
    Assert.assertEquals(propInfo.getProperty("system_connectemc_smtp_emcto"), email.getPrimaryEmailAddress());
    Assert.assertEquals(propInfo.getProperty("system_connectemc_smtp_from"), email.getEmailSender());
    Assert.assertEquals(propInfo.getProperty("system_connectemc_smtp_to"), email.getNotifyEmailAddress());
    Assert.assertEquals(propInfo.getProperty("system_connectemc_enabletls"), email.getStartTls());
    Assert.assertEquals(propInfo.getProperty("system_connectemc_encrypt"), email.getSafeEncryption());
    Assert.assertEquals(propInfo.getProperty("system_connectemc_smtp_authtype"), email.getSmtpAuthType());
    Assert.assertEquals(propInfo.getProperty("system_connectemc_smtp_username"), email.getUserName());
    Assert.assertEquals(propInfo.getProperty("system_connectemc_smtp_password"), email.getPassword());
}
Also used : ConnectEmcEmail(com.emc.vipr.model.sys.eventhandler.ConnectEmcEmail) PropertyInfoUpdate(com.emc.storageos.model.property.PropertyInfoUpdate) Test(org.junit.Test)

Example 3 with ConnectEmcEmail

use of com.emc.vipr.model.sys.eventhandler.ConnectEmcEmail in project coprhd-controller by CoprHD.

the class ConfigServiceTest method testInvalidAuthType.

@Test
public void testInvalidAuthType() {
    ConnectEmcEmail email = new ConnectEmcEmail();
    email.setEmailSender("DONOTREPLY@customer.com");
    email.setEmailServer("mailhub.lss.emc.com");
    email.setNotifyEmailAddress("joe.customer@customer.com");
    email.setPrimaryEmailAddress("emailalertesg@emc.com");
    email.setSafeEncryption("no");
    email.setUserName("root");
    email.setPassword("ChangeMe");
    email.setSmtpAuthType("Null");
}
Also used : ConnectEmcEmail(com.emc.vipr.model.sys.eventhandler.ConnectEmcEmail) Test(org.junit.Test)

Example 4 with ConnectEmcEmail

use of com.emc.vipr.model.sys.eventhandler.ConnectEmcEmail in project coprhd-controller by CoprHD.

the class ConfigServiceTest method testEmailUsingAuthAndCerts.

@Test
public void testEmailUsingAuthAndCerts() {
    ConnectEmcEmail email = new ConnectEmcEmail();
    email.setEmailSender("DONOTREPLY@customer.com");
    email.setEmailServer("mailhub.lss.emc.com");
    email.setNotifyEmailAddress("joe.customer@customer.com");
    email.setPrimaryEmailAddress("emailalertesg@emc.com");
    email.setSafeEncryption("no");
    email.setUserName("root");
    email.setPassword("ChangeMe");
    try {
        email.setStartTls("yes");
        email.setSmtpAuthType("login");
    } catch (Exception e) {
        Assert.fail();
    }
    PropertyInfoUpdate propInfo = ConfigService.ConfigureConnectEmc.configureEmail(email);
    Assert.assertEquals(propInfo.getProperty("system_connectemc_smtp_server"), email.getEmailServer());
    Assert.assertEquals(propInfo.getProperty("system_connectemc_smtp_emcto"), email.getPrimaryEmailAddress());
    Assert.assertEquals(propInfo.getProperty("system_connectemc_smtp_from"), email.getEmailSender());
    Assert.assertEquals(propInfo.getProperty("system_connectemc_smtp_to"), email.getNotifyEmailAddress());
    Assert.assertEquals(propInfo.getProperty("system_connectemc_smtp_enabletls"), email.getStartTls());
    Assert.assertEquals(propInfo.getProperty("system_connectemc_encrypt"), email.getSafeEncryption());
    Assert.assertEquals(propInfo.getProperty("system_connectemc_smtp_authtype"), email.getSmtpAuthType());
    Assert.assertEquals(propInfo.getProperty("system_connectemc_smtp_username"), email.getUserName());
    Assert.assertEquals(propInfo.getProperty("system_connectemc_smtp_password"), email.getPassword());
}
Also used : ConnectEmcEmail(com.emc.vipr.model.sys.eventhandler.ConnectEmcEmail) PropertyInfoUpdate(com.emc.storageos.model.property.PropertyInfoUpdate) Test(org.junit.Test)

Example 5 with ConnectEmcEmail

use of com.emc.vipr.model.sys.eventhandler.ConnectEmcEmail in project coprhd-controller by CoprHD.

the class ConfigServiceTest method testEmailUsingAuthWithNoUsernamePassword.

@Test
public void testEmailUsingAuthWithNoUsernamePassword() {
    ConnectEmcEmail email = new ConnectEmcEmail();
    email.setEmailSender("DONOTREPLY@customer.com");
    email.setEmailServer("mailhub.lss.emc.com");
    email.setNotifyEmailAddress("joe.customer@customer.com");
    email.setPrimaryEmailAddress("emailalertesg@emc.com");
    email.setSafeEncryption("no");
    email.setSmtpAuthType("login");
    PropertyInfoUpdate propInfo = null;
    try {
        propInfo = ConfigService.ConfigureConnectEmc.configureEmail(email);
    } catch (Exception e) {
        Assert.assertNull(propInfo);
        return;
    }
    Assert.fail();
}
Also used : ConnectEmcEmail(com.emc.vipr.model.sys.eventhandler.ConnectEmcEmail) PropertyInfoUpdate(com.emc.storageos.model.property.PropertyInfoUpdate) Test(org.junit.Test)

Aggregations

ConnectEmcEmail (com.emc.vipr.model.sys.eventhandler.ConnectEmcEmail)6 Test (org.junit.Test)6 PropertyInfoUpdate (com.emc.storageos.model.property.PropertyInfoUpdate)4