assertNotSame(before,after);
assertEqualBeans(before,after,"recipients,dontNotifyEveryUnstableBuild,sendToIndividuals");
}
public void testGlobalConfigRoundtrip() throws Exception {
DescriptorImpl d = Mailer.descriptor();
d.setAdminAddress("admin@me");
d.setDefaultSuffix("default-suffix");
d.setHudsonUrl("http://nowhere/");
d.setSmtpHost("smtp.host");
d.setSmtpPort("1025");
d.setUseSsl(true);
d.setSmtpAuth("user","pass");
submit(new WebClient().goTo("configure").getFormByName("config"));
assertEquals("admin@me",d.getAdminAddress());
assertEquals("default-suffix",d.getDefaultSuffix());
assertEquals("http://nowhere/",d.getUrl());
assertEquals("smtp.host",d.getSmtpServer());
assertEquals("1025",d.getSmtpPort());
assertEquals(true,d.getUseSsl());
assertEquals("user",d.getSmtpAuthUserName());
assertEquals("pass",d.getSmtpAuthPassword());
d.setUseSsl(false);
d.setSmtpAuth(null,null);
submit(new WebClient().goTo("configure").getFormByName("config"));
assertEquals(false,d.getUseSsl());
assertNull("expected null, got: " + d.getSmtpAuthUserName(), d.getSmtpAuthUserName());
assertNull("expected null, got: " + d.getSmtpAuthPassword(), d.getSmtpAuthPassword());
}