assertTrue(adrr.getAddress().equals(testMail.getTo()));
String hash = testMail.extractLink().substring(testMail.extractLink().lastIndexOf('=') + 1);
adrr.verify(hash);
+ }
+
+ @Test
+ public void testMailAddInternalFaulty() {
try {
new EmailAddress("kurti ", u);
+ fail();
} catch (IllegalArgumentException e) {
// Intended.
- return;
}
- fail();
}
@Test
fail();
}
+ @Test
+ public void testMailAddWebFaulty() throws MalformedURLException, UnsupportedEncodingException, IOException {
+ String newMail = createUniqueName() + "uniexample.org";
+ assertNotNull(executeBasicWebInteraction(cookie, path,
+ "addmail&newemail=" + URLEncoder.encode(newMail, "UTF-8"), 1));
+ EmailAddress[] addrs = u.getEmails();
+ for (int i = 0; i < addrs.length; i++) {
+ if (addrs[i].getAddress().equals(newMail)) {
+ fail();
+ }
+ }
+ }
}