params.put("smtpUserName", "username");
params.put("smtpPassword", "password");
String result = this.executeSave("admin", params);
assertEquals(Action.SUCCESS, result);
MailConfig config = this._mailManager.getMailConfig();
assertEquals("host", config.getSmtpHost());
assertNull(config.getSmtpPort());
assertNull(config.getSmtpTimeout());
assertEquals("username", config.getSmtpUserName());
assertEquals("password", config.getSmtpPassword());
params.put("smtpPort", "2525");
params.put("smtpTimeout", "2000");
result = this.executeSave("admin", params);
assertEquals(Action.SUCCESS, result);
config = this._mailManager.getMailConfig();
assertEquals("host", config.getSmtpHost());
assertEquals(new Integer(2525), config.getSmtpPort());
assertEquals(new Integer(2000), config.getSmtpTimeout());
assertEquals("username", config.getSmtpUserName());
assertEquals("password", config.getSmtpPassword());
} catch (Throwable t) {
throw t;
} finally {
this._helper.resetConfig();
}