Skip to content

Commit

Permalink
feat: test extension
Browse files Browse the repository at this point in the history
  • Loading branch information
Yazan Amer authored and m-adawi committed Oct 7, 2023
1 parent 0470f7b commit 5cea87b
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

class SMTPEmailServiceTest {
private static final String EXPECTED_ID = "LETTER_ID";
public static final String EXPECTED_EMAIL = "[email protected]";
public static final String EXPECTED_RECEIVER_EMAIL = "[email protected]";
public static final String TOKEN_ID = "TOKEN_ID";
public static final String SECRET = "SECRET";
private SMTPEmailService service;
Expand All @@ -33,7 +33,7 @@ void testSendVerificationEmail() {
ArgumentCaptor<SimpleMailMessage> argumentCaptor = ArgumentCaptor.forClass(SimpleMailMessage.class);
verify(mailSender).send(argumentCaptor.capture());
SimpleMailMessage sentMessage = argumentCaptor.getValue();
assertArrayEquals(new String[]{EXPECTED_EMAIL}, sentMessage.getTo());
assertArrayEquals(new String[]{EXPECTED_RECEIVER_EMAIL}, sentMessage.getTo());
assertEquals("Recommendation letter verification link", sentMessage.getSubject());
assertTrue(sentMessage.getText().contains("/api/v1/recommendation-letter/verify/LETTER_ID/TOKEN_ID/SECRET"));
}
Expand All @@ -43,7 +43,7 @@ private static VerificationLinkEmailRequest buildRequest() {
request.setLetterId(EXPECTED_ID);
request.setTokenId(TOKEN_ID);
request.setSecretToken(SECRET);
request.setReceiverEmail(EXPECTED_EMAIL);
request.setReceiverEmail(EXPECTED_RECEIVER_EMAIL);
return request;
}
}

0 comments on commit 5cea87b

Please sign in to comment.