From the course: Complete Guide To Java Testing with JUnit 5 & Mockito
Unlock the full course today
Join today to access over 24,900 courses taught by industry experts.
Integration testing with Spring Boot
From the course: Complete Guide To Java Testing with JUnit 5 & Mockito
Integration testing with Spring Boot
- [Instructor] Integration testing is crucial for ensuring that all components of your Spring Boot application work together correctly. However, the idea of integration testing often has many meanings. Let's take a look at some examples. Here in the user controller test, we technically tested the integration of the controller and its interactions with the MBC infrastructure. If this was purely a unit test, we'd mock the user service dependency with the regular mock annotation instead of mock bean and remove the web MBC test annotation and the mock MBC component. The user repository test is also an integration test. It tests the integration of the user repository and the embedded database. The data JPA test annotation also ensures that your JPA components are configured correctly and can interact with the database. Notice nothing is mocked here. It's testing the real interactions. Now, even though these are technically integration tests, they do not cover complete integration testing…
Contents
-
-
-
-
-
-
-
-
-
-
(Locked)
Walk through a basic Spring Boot application3m 53s
-
(Locked)
Write your first Spring Boot test3m 43s
-
(Locked)
Test Spring data repositories6m 1s
-
(Locked)
Test Spring services4m 9s
-
(Locked)
Test Spring controllers5m 58s
-
(Locked)
Integration testing with Spring Boot10m 40s
-
(Locked)
Best practices and tips for testing Spring Applications2m 9s
-
(Locked)
Challenge: Test a Spring weather application1m 8s
-
(Locked)
Solution: Test a Spring weather application16m 37s
-
(Locked)
-