Spring Data makes persistence much easier. I personally not a huge fan of JPA and ORMs. However, I know lots of engineers like it and I respect different preferences. Have different preferences in different services is totally fine. However, doing that in shared libs is NO-NO. Today I want to cover a bit more about how we can use Spring Data JPA and H2 database for testing. Speed matters. Combining H2 and MockMVC we can speed up tests considerably. I made a simple POC showing how we can configure and use Spring Data JPA with H2 and do proper testing using MockMVC capabilities. I also show how to use the H2 Console so we can query the database. Spring-Data makes persistence much more concise and leverages lots of common functionality for us. So Let’s get started.
You can't perform that action at this time. You signed in with another tab or window. You signed out in another tab or…
Originally published at http://diego-pacheco.blogspot.com on January 27, 2021.