diff --git a/src/test/java/ubc/pavlab/rdp/validation/EmailValidatorTest.java b/src/test/java/ubc/pavlab/rdp/validation/EmailValidatorTest.java index 81c6cb5f..40a061c6 100644 --- a/src/test/java/ubc/pavlab/rdp/validation/EmailValidatorTest.java +++ b/src/test/java/ubc/pavlab/rdp/validation/EmailValidatorTest.java @@ -45,6 +45,14 @@ public void validate_whenIdnIsEnabledAndDomainHasUnicodeSymbols_thenAccept() { verifyNoInteractions( e ); } + @Test + public void validate_whenIdnIsEnabledAndDomainHasInvalidUnicodeSymbols_thenReject() { + v = new EmailValidator( (AllowedDomainStrategy) null, true ); + // that's the code for a chequered flag 🏁 + v.validate( "foo@B\uD83C\uDFC1cher.example", e ); + verify( e ).rejectValue( isNull(), eq( "EmailValidator.domainNotConformToRfc3490" ), any(), isNull() ); + } + @Test public void validate_whenDomainContainsUnsupportedCharacters_thenReject() { v.validate( "foo@Bücher.example", e );