@Test void validator_WillFail_WhenEmailIsMissingHostname() { assertThrows(IllegalArgumentException.class, () -> emailAddressValidator.validate(() -> "bob@")); }
@Override public void validate(EmailAddressValidatableCommand validatable) { if (validatable.getEmailAddress() == null) { return; } Validate.isTrue(EmailValidator.getInstance(false).isValid(validatable.getEmailAddress()), "Malformed email address"); }
EmailAddressValidator implements Validates<EmailAddressValidatableCommand> { @Override public void validate(EmailAddressValidatableCommand validatable) { if (validatable.getEmailAddress() == null) { return; } Validate.isTrue(EmailValidator.getInstance(false).isValid(validatable.getEmailAddress()), "Malformed email address"); } }
EmailAddressValidator implements Validates<EmailAddressValidatableCommand> { @Override public void validate(EmailAddressValidatableCommand validatable) { if (validatable.getEmailAddress() == null) { return; } Validate.isTrue(EmailValidator.getInstance(false).isValid(validatable.getEmailAddress()), "Malformed email address"); }  }
EmailAddressValidator implements Validates<EmailAddressValidatableCommand> { @Override public void validate(EmailAddressValidatableCommand validatable) { if (validatable.getEmailAddress() == null) { return; } Validate.isTrue(EmailValidator.getInstance(false).isValid(validatable.getEmailAddress()), "Malformed email address"); }  @Override void validate(EmailAddressValidatableCommand validatable); }
EmailAddressValidator implements Validates<EmailAddressValidatableCommand> { @Override public void validate(EmailAddressValidatableCommand validatable) { if (validatable.getEmailAddress() == null) { return; } Validate.isTrue(EmailValidator.getInstance(false).isValid(validatable.getEmailAddress()), "Malformed email address"); }  @Override void validate(EmailAddressValidatableCommand validatable);  }