Package io.micronaut.email.test
Class MailTestUtils
java.lang.Object
io.micronaut.email.test.MailTestUtils
Utility to read and delete emails from a Gmail inbox. Useful to test Transactional email integration.
- Author:
- Sergio del Amo
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic int
countAndDeleteInboxEmailsBySubject
(String subject) static int
countAndDeleteInboxEmailsBySubject
(String user, String password, String subject)
-
Constructor Details
-
MailTestUtils
public MailTestUtils()
-
-
Method Details
-
countAndDeleteInboxEmailsBySubject
public static int countAndDeleteInboxEmailsBySubject(String user, String password, String subject) throws jakarta.mail.MessagingException - Parameters:
user
- SMTP userpassword
- SMTP passwordsubject
- Target subject- Returns:
- the number of emails which matched the target subject
- Throws:
jakarta.mail.MessagingException
- exception thrown while reading emails
-
countAndDeleteInboxEmailsBySubject
public static int countAndDeleteInboxEmailsBySubject(String subject) throws jakarta.mail.MessagingException - Parameters:
subject
- Target subject- Returns:
- the number of emails which matched the target subject
- Throws:
jakarta.mail.MessagingException
- exception thrown while reading emails
-