Skip to content

Commit

Permalink
Merge pull request #926 from alphagov/zd4422632
Browse files Browse the repository at this point in the history
zd4422632: Allow email from Fermanagh & Omagh District Council
  • Loading branch information
oswaldquek authored Jan 13, 2021
2 parents bb3543c + 49a850b commit 5c2f472
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ public class EmailValidator {
"cynulliad.cymru",
"derrystrabane.com",
"eani.org.uk",
"fermanaghomagh.com",
"gov.scot",
"gov.uk",
"gov.wales",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.core.Is.is;

public class EmailValidatorIsPublicSectorEmailTest {
class EmailValidatorIsPublicSectorEmailTest {

public static Collection<Object[]> data() {
static Collection<Object[]> data() {
return List.of(new Object[][] {
// main validations
{"", false},
Expand Down Expand Up @@ -55,6 +55,7 @@ public static Collection<Object[]> data() {
{"valid@cynulliad.cymru", true},
{"valid@derrystrabane.com", true},
{"valid@eani.org.uk", true},
{"valid@fermanaghomagh.com", true},
{"valid@gov.scot", true},
{"valid@gov.uk", true},
{"valid@gov.wales", true},
Expand Down Expand Up @@ -97,6 +98,7 @@ public static Collection<Object[]> data() {
{"valid@subdomain.cynulliad.cymru", true},
{"valid@subdomain.derrystrabane.com", true},
{"valid@subdomain.eani.org.uk", true},
{"valid@subdomain.fermanaghomagh.com", true},
{"valid@subdomain.gov.scot", true},
{"valid@subdomain.gov.uk", true},
{"valid@subdomain.gov.wales", true},
Expand Down Expand Up @@ -128,14 +130,14 @@ public static Collection<Object[]> data() {
{"valid@subdomain.sssc.uk.com", true},
{"valid@subdomain.wmca.org.uk", true},
{"valid@subdomain.york.ac.uk", true},
{"valid@subdomain.digitalaccessibilitycentre.org", true},
{"valid@subdomain.digitalaccessibilitycentre.org", true}

});
}

@ParameterizedTest
@MethodSource("data")
public void isPublicSectorEmail_shouldEvaluateWhetherOrNotItIsPublicSectorEmail(
void isPublicSectorEmail_shouldEvaluateWhetherOrNotItIsPublicSectorEmail(
String email, boolean testResult) {
boolean result = EmailValidator.isPublicSectorEmail(email);
assertThat("Expected " + email + " to be " + (testResult ? "valid" : "invalid"), result, is(testResult));
Expand Down

0 comments on commit 5c2f472

Please sign in to comment.