@Test public void testBuildForListOfUsers() { Properties props = createPropertiesFor(PropertiesBasedGreenMailConfigurationBuilder.GREENMAIL_USERS, "foo1:pwd1@bar.com,foo2:pwd2,foo3:pwd3@bar3.com"); GreenMailConfiguration config = new PropertiesBasedGreenMailConfigurationBuilder().build(props); assertThat(config).isNotNull(); assertThat(config.getUsersToCreate()).hasSize(3); assertThat(config.getUsersToCreate().get(0)).isEqualTo(new UserBean("foo1@bar.com", "foo1", "pwd1")); assertThat(config.getUsersToCreate().get(1)).isEqualTo(new UserBean("foo2", "foo2", "pwd2")); assertThat(config.getUsersToCreate().get(2)).isEqualTo(new UserBean("foo3@bar3.com", "foo3", "pwd3")); }
public GreenMailConfiguration build(Properties properties) { GreenMailConfiguration configuration = new GreenMailConfiguration(); String usersParam = properties.getProperty(GREENMAIL_USERS); if (null != usersParam) { String[] usersArray = usersParam.split(","); for (String user : usersArray) { extractAndAddUser(configuration, user); } } String disabledAuthentication = properties.getProperty(GREENMAIL_AUTH_DISABLED); if (null != disabledAuthentication) { configuration.withDisabledAuthentication(); } return configuration; }
PropertiesBasedGreenMailConfigurationBuilder { public GreenMailConfiguration build(Properties properties) { GreenMailConfiguration configuration = new GreenMailConfiguration(); String usersParam = properties.getProperty(GREENMAIL_USERS); if (null != usersParam) { String[] usersArray = usersParam.split(","); for (String user : usersArray) { extractAndAddUser(configuration, user); } } String disabledAuthentication = properties.getProperty(GREENMAIL_AUTH_DISABLED); if (null != disabledAuthentication) { configuration.withDisabledAuthentication(); } return configuration; } }
PropertiesBasedGreenMailConfigurationBuilder { public GreenMailConfiguration build(Properties properties) { GreenMailConfiguration configuration = new GreenMailConfiguration(); String usersParam = properties.getProperty(GREENMAIL_USERS); if (null != usersParam) { String[] usersArray = usersParam.split(","); for (String user : usersArray) { extractAndAddUser(configuration, user); } } String disabledAuthentication = properties.getProperty(GREENMAIL_AUTH_DISABLED); if (null != disabledAuthentication) { configuration.withDisabledAuthentication(); } return configuration; }  }
PropertiesBasedGreenMailConfigurationBuilder { public GreenMailConfiguration build(Properties properties) { GreenMailConfiguration configuration = new GreenMailConfiguration(); String usersParam = properties.getProperty(GREENMAIL_USERS); if (null != usersParam) { String[] usersArray = usersParam.split(","); for (String user : usersArray) { extractAndAddUser(configuration, user); } } String disabledAuthentication = properties.getProperty(GREENMAIL_AUTH_DISABLED); if (null != disabledAuthentication) { configuration.withDisabledAuthentication(); } return configuration; }  GreenMailConfiguration build(Properties properties); }
PropertiesBasedGreenMailConfigurationBuilder { public GreenMailConfiguration build(Properties properties) { GreenMailConfiguration configuration = new GreenMailConfiguration(); String usersParam = properties.getProperty(GREENMAIL_USERS); if (null != usersParam) { String[] usersArray = usersParam.split(","); for (String user : usersArray) { extractAndAddUser(configuration, user); } } String disabledAuthentication = properties.getProperty(GREENMAIL_AUTH_DISABLED); if (null != disabledAuthentication) { configuration.withDisabledAuthentication(); } return configuration; }  GreenMailConfiguration build(Properties properties); static final String GREENMAIL_USERS; static final String GREENMAIL_AUTH_DISABLED; }