-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Changed disposable email domain in integration test
- Loading branch information
Showing
2 changed files
with
10 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,22 +10,24 @@ | |
|
||
class DisposableEmailProvidersTest { | ||
|
||
private static final ObjectMapper objectMapper = new ObjectMapper(); | ||
|
||
@Test | ||
void isDisposableEmailProviders() { | ||
Environment environment = new MockEnvironment(); | ||
DisposableEmailProviders subject = new DisposableEmailProviders(new ObjectMapper(), environment, true); | ||
assertThrows(DisposableEmailProviderException.class, () -> subject.verifyDisposableEmailProviders("jdoe@TRASHMAIL.LIVE")); | ||
DisposableEmailProviders subject = new DisposableEmailProviders(objectMapper, environment, true); | ||
assertThrows(DisposableEmailProviderException.class, () -> subject.verifyDisposableEmailProviders("jdoe@TRASHMAIL.WS")); | ||
subject.verifyDisposableEmailProviders("[email protected]"); | ||
|
||
DisposableEmailProviders subjectFeatureOff = new DisposableEmailProviders(new ObjectMapper(), environment, false); | ||
subjectFeatureOff.verifyDisposableEmailProviders("jdoe@trashmail.live"); | ||
DisposableEmailProviders subjectFeatureOff = new DisposableEmailProviders(objectMapper, environment, false); | ||
subjectFeatureOff.verifyDisposableEmailProviders("jdoe@TRASHMAIL.WS"); | ||
} | ||
|
||
@Test | ||
void isDisposableEmailProvidersLocalEnvironment() { | ||
MockEnvironment environment = new MockEnvironment(); | ||
environment.addActiveProfile("test"); | ||
DisposableEmailProviders subject = new DisposableEmailProviders(new ObjectMapper(), environment, true); | ||
assertThrows(DisposableEmailProviderException.class, () -> subject.verifyDisposableEmailProviders("jdoe@ujixlaxpros.tech")); | ||
DisposableEmailProviders subject = new DisposableEmailProviders(objectMapper, environment, true); | ||
assertThrows(DisposableEmailProviderException.class, () -> subject.verifyDisposableEmailProviders("jdoe@UJIXLAXPROS.tech")); | ||
} | ||
} |