### Question:
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; }### Answer:
@Test public void testBuildForSingleUser() { Properties props = createPropertiesFor(PropertiesBasedGreenMailConfigurationBuilder.GREENMAIL_USERS, "foo1:pwd1@bar.com"); GreenMailConfiguration config = new PropertiesBasedGreenMailConfigurationBuilder().build(props); assertThat(config).isNotNull(); assertThat(config.getUsersToCreate()).hasSize(1); assertThat(config.getUsersToCreate().get(0)).isEqualTo(new UserBean("foo1@bar.com", "foo1", "pwd1")); }
@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")); }
@Test public void testBuildWithAuthenticationDisabledSetting() { Properties props = createPropertiesFor(PropertiesBasedGreenMailConfigurationBuilder.GREENMAIL_AUTH_DISABLED, ""); GreenMailConfiguration config = new PropertiesBasedGreenMailConfigurationBuilder().build(props); assertThat(config).isNotNull(); assertThat(config.isAuthenticationDisabled()).isTrue(); }