-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
01871fe
commit f514932
Showing
3 changed files
with
10 additions
and
12 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
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 |
---|---|---|
|
@@ -49,6 +49,7 @@ class AwsSesClientTest { | |
@Test | ||
void sendEmailPRODSuccess() { | ||
ReflectionTestUtils.setField(sut, "enableSendEmail", true); | ||
ReflectionTestUtils.setField(sut, "environment", "PROD"); | ||
|
||
Institutions institutions = buildInstitutions(); | ||
List<InstitutionProductUsers> institutionProductUsers = buildInstitutionProductUsers(); | ||
|
@@ -69,6 +70,7 @@ void sendEmailPRODSuccess() { | |
@Test | ||
void sendEmailNotPRODSuccess() { | ||
ReflectionTestUtils.setField(sut, "enableSendEmail", false); | ||
ReflectionTestUtils.setField(sut, "environment", "UAT"); | ||
|
||
when(templateEngine.process(anyString(), any())).thenReturn("html template"); | ||
when(sesClient.sendEmail(any(SendEmailRequest.class))).thenReturn(SendEmailResponse.builder().build()); | ||
|
@@ -87,6 +89,7 @@ void sendEmailNotPRODSuccess() { | |
@Test | ||
void sendEmailPRODFail() { | ||
ReflectionTestUtils.setField(sut, "enableSendEmail", true); | ||
ReflectionTestUtils.setField(sut, "environment", "PROD"); | ||
|
||
Institutions institutions = buildInstitutions(); | ||
List<InstitutionProductUsers> institutionProductUsers = buildInstitutionProductUsers(); | ||
|
@@ -108,6 +111,7 @@ void sendEmailPRODFail() { | |
void sendEmailPRODNoInstitutionTaxCodeSkipped() { | ||
ReflectionTestUtils.setField(sut, "enableSendEmail", true); | ||
ReflectionTestUtils.setField(sut, "testEmailAddress", "[email protected]"); | ||
ReflectionTestUtils.setField(sut, "environment", "PROD"); | ||
|
||
assertDoesNotThrow(() -> sut.sendEmail(buildEmailMessageDetail(null))); | ||
|
||
|
@@ -125,6 +129,7 @@ void sendEmailPRODNoInstitutionTaxCodeSkipped() { | |
@Test | ||
void sendEmailNoInstitutionFoundSkipped() { | ||
ReflectionTestUtils.setField(sut, "enableSendEmail", true); | ||
ReflectionTestUtils.setField(sut, "environment", "PROD"); | ||
|
||
when(externalApiClient.getInstitutionsFiltered(INSTITUTION_TAX_CODE)) | ||
.thenReturn(Institutions.builder().institutions(Collections.emptyList()).build()); | ||
|
@@ -144,6 +149,7 @@ void sendEmailNoInstitutionFoundSkipped() { | |
@Test | ||
void sendEmailNoDestinationSkipped() { | ||
ReflectionTestUtils.setField(sut, "enableSendEmail", true); | ||
ReflectionTestUtils.setField(sut, "environment", "PROD"); | ||
|
||
Institutions institutions = buildInstitutions(); | ||
|
||
|
@@ -165,6 +171,7 @@ void sendEmailNoDestinationSkipped() { | |
void sendEmailNotPRODAndNoTestEmailSkipped() { | ||
ReflectionTestUtils.setField(sut, "enableSendEmail", false); | ||
ReflectionTestUtils.setField(sut, "testEmailAddress", null); | ||
ReflectionTestUtils.setField(sut, "environment", "UAT"); | ||
|
||
assertDoesNotThrow(() -> sut.sendEmail(buildEmailMessageDetail(INSTITUTION_TAX_CODE))); | ||
|
||
|
@@ -182,6 +189,7 @@ void sendEmailNotPRODAndNoTestEmailSkipped() { | |
@Test | ||
void sendEmailPRODSWithPagopaOperatorSuccess() { | ||
ReflectionTestUtils.setField(sut, "enableSendEmail", true); | ||
ReflectionTestUtils.setField(sut, "environment", "PROD"); | ||
|
||
Institutions institutions = buildInstitutions(); | ||
List<InstitutionProductUsers> institutionProductUsers = buildInstitutionProductUsers(); | ||
|