/** * Sets error message key for emailValidator * * @param emailValidator validator to update * @param errorMessageKey new error message key */ public static void setErrorMessageKey(EmailValidator emailValidator, String errorMessageKey) { emailValidator.setErrorMessage(errorMessageKey); }
@Test public void testEmailValidatorWithOkEmail() { Assert.assertTrue(validator.isValid("*****@*****.**")); }
@Test public void testEmailValidatorWithEmptyString() { Assert.assertTrue(validator.isValid("")); }
@Test public void testEmailValidatorWithFaultyString() { Assert.assertFalse(validator.isValid("not.an.email")); }
@Test public void testEmailValidatorWithNull() { Assert.assertTrue(validator.isValid(null)); }