In this video tutorial, we will learn how to do Spring Boot application Integration Testing using Testcontainers.
Check out my Spring boot testing Udemy course: https://www.udemy.com/course/testing-...
First, we write Integration tests using a local MySQL database, and then we will address the problem with Testcontainers as a solution.
Chapters:
[04:03] What problem do Testcontainers solve
[06:17] Testcontainers overview
[09:37] Create Spring boot project
[13:16] Configure MySQL Database
[14:56] Create Student JPA entity
[17:56] Create Student JPA Repository
[18:58] Create StudentController and REST APIs
[22:31] Write Integration Test for REST API
[32:58] Run Integration Test
[33:51] What is the problem with Integration Test
[34:44] Adding Testcontainers
[37:21] Integration testing using Testcontainers
[44:52] Using Singleton containers pattern
[48:38] Run Integration Test
SpringBoot provides excellent support for integration testing using @SpringBootTest annotation.
Testcontainers is a Java library that supports JUnit tests, providing lightweight, throwaway instances of common databases, Selenium web browsers, or anything else that can run in a Docker container.
Testcontainer allows us to use Docker containers within our tests. As a result, we can write self-contained integration tests that depend on external resources.
Blog post: https://www.javaguides.net/2022/01/sp...
GitHub repository at https://github.com/RameshMF/springboo...
#springboot #testing #testcontainers
На этой странице сайта вы можете посмотреть видео онлайн Spring Boot Testing - REST API Integration Testing using Testcontainers | Crash Course длительностью часов минут секунд в хорошем качестве, которое загрузил пользователь Java Guides 17 Январь 2022, поделитесь ссылкой с друзьями и знакомыми, на youtube это видео уже посмотрели 23,108 раз и оно понравилось 367 зрителям. Приятного просмотра!