Integration Testing with Spring: Consumers
We’ve been through a lot. We’ve covered all kinds of flows to be tested on the server side. We’ve seen how to check flows from the controller down to the database, combined with injecting different mocks and services. We’ve got one more thing: What happens if my controller (or any Read more…
Integration Testing with Spring – Controllers II
We’ve gone over what we needed from Spring to test a controller. And Spring is about to give it to us. Here’s a controller: This controller has GET and POST APIs. It has some logic in it (although this is something we probably don’t want. We’d rather push that into Read more…
Integration Testing with Spring – Controllers I
In Spring, Controllers allow external consumers to use REST APIs to call into the application logic. This is very convenient, since we don’t need to write a whole translation level. Spring controllers give us full access to the request parameters and headers, and allows us to create a response and Read more…
Integration Testing with Spring – Data III
Hibernate and JPA have done a lot for developers in minimizing the code needed to write database applications. Spring Data does a lot of magic behind the code for us, and we’d like to take advantage of that magic. Let’s start with the basics: In JPA we’re mapping objects to Read more…
Integration Testing with Spring – Data II
Today we’ll tackle JDBC options for testing in Spring. Before we start, there’s one more annotation to learn from Spring: @Repository. We put it on a class to tell Spring that this is a data class, talking to a data source. A @Repository is basically a component or a bean. Read more…
Integration Testing with Spring – Data I
We’ve discussed what Spring can do for us in terms of integration tests so far, but nothing says more integration than database integration. First, let’s define what we want in our integration tests, before we describe how the wonderful people of Spring and Spring Boot help us achieve it. In Read more…