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

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