From the course: Advanced Spring: Effective Integration Testing with Spring Boot

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Writing integration tests for a JPA repository

Writing integration tests for a JPA repository

From the course: Advanced Spring: Effective Integration Testing with Spring Boot

Start my 1-month free trial

Writing integration tests for a JPA repository

- [Instructor] Let's take into practice everything we've learned so far by writing our first test. When it comes to testing, there are two different approaches we can use from the smallest component all the way up which is called bottom up approach or inside out. This approach is great When we have two different teams working independently on a different services and we are not so worried about integration. However, when we have two different teams and we know integration is going to be risky in this case, we want to prioritize building the integration and points first, and then focus on smaller components. This is called Top-down approach or outside-in. In our example, we are going to start with Bottom up Approach by writing integration tests for our repository. We want to prove we can retrieve objects from the database by queering it by student name. We want to verify that student object maps correctly to the database. We will write our tests first and then the actual…

Contents