Город МОСКОВСКИЙ
00:15:09

Testing Email Sending for Spring Boot Applications With GreenMail (Sandbox Email Server)

Аватар
Kotlin Архив
Просмотры:
27
Дата загрузки:
02.12.2023 01:47
Длительность:
00:15:09
Категория:
Обучение

Описание

This video showcases a testing recipe to write integration tests that involve email sending. To avoid real emails being sent out for our tests, we can use a sandbox email server to capture and verify all emails.

For demonstration purposes, we're using a Spring Boot application (JavaMailSender) and GreenMail but the recipe can be applied to any Java application.

Content:

00:00 Sample application walkthrough
03:19 Adding GreenMail to the project
05:20 Integration test setup to trigger the email sending
08:20 Adding GreenMail's JUnit Jupiter extension
12:00 Verifying the received emails after our test

You can find the source code for this test example on GitHub: https://github.com/rieckpil/blog-tutorials/tree/master/spring-boot-test-mail-sending


» Getting started with testing Spring Boot applications in three hours with the Testing Spring Boot Applications Primer Online Course: https://rieckpil.de/testing-spring-boot-applications-primer/

#springboot #greenmail #testing #junit5 #integrationtesting

Рекомендуемые видео