Skip to content

Commit

Permalink
Fixes #313
Browse files Browse the repository at this point in the history
  • Loading branch information
oharsta committed Sep 29, 2024
1 parent ad64d7a commit 83333f7
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
public class EmailFormatValidator implements FormatValidator {

private static final Pattern pattern =
Pattern.compile("^\\S+@\\S+$", Pattern.CASE_INSENSITIVE);
Pattern.compile("^.+@.+$", Pattern.CASE_INSENSITIVE);

@Override
public boolean isValid(String subject) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package access.validation;

import org.junit.jupiter.api.Test;

import static org.junit.jupiter.api.Assertions.*;

class EmailFormatValidatorTest {

private final EmailFormatValidator emailFormatValidator = new EmailFormatValidator();

@Test
void isValid() {
assertTrue(emailFormatValidator.isValid("o@o"));
assertTrue(emailFormatValidator.isValid("Frits Voorbeeld <[email protected]>"));

}
}

0 comments on commit 83333f7

Please sign in to comment.