-
Notifications
You must be signed in to change notification settings - Fork 3
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
47474a7
commit 1a4ce93
Showing
2 changed files
with
11 additions
and
13 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 |
---|---|---|
@@ -1,8 +1,9 @@ | ||
package com.example.awsspring.service; | ||
|
||
import static org.awaitility.Awaitility.await; | ||
|
||
import com.example.awsspring.common.AbstractIntegrationTest; | ||
import java.time.Duration; | ||
import org.awaitility.Awaitility; | ||
import org.hamcrest.Matchers; | ||
import org.junit.jupiter.api.Test; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
|
@@ -20,8 +21,7 @@ void testSendMail() { | |
simpleMailMessage.setSubject("test subject"); | ||
simpleMailMessage.setText("test text"); | ||
|
||
Awaitility.await() | ||
.atLeast(Duration.ofSeconds(1)) | ||
await().atLeast(Duration.ofSeconds(1)) | ||
.atMost(Duration.ofSeconds(60)) | ||
.with() | ||
.pollInterval(Duration.ofSeconds(1)) | ||
|
@@ -32,12 +32,12 @@ void testSendMail() { | |
|
||
@Test | ||
void testSendMailWithAttachments() { | ||
SimpleMailMessage simpleMailMessage = new SimpleMailMessage(); | ||
simpleMailMessage.setFrom("[email protected]"); | ||
simpleMailMessage.setTo("[email protected]"); | ||
simpleMailMessage.setSubject("test subject"); | ||
simpleMailMessage.setText("test text"); | ||
|
||
notificationService.sendMailMessage(simpleMailMessage); | ||
await().atLeast(Duration.ofSeconds(1)) | ||
.atMost(Duration.ofSeconds(60)) | ||
.with() | ||
.pollInterval(Duration.ofSeconds(1)) | ||
.until( | ||
() -> notificationService.sendMailMessageWithAttachments(), | ||
Matchers.equalTo("sent")); | ||
} | ||
} |