Spring boot with embedded PostgreSQL for DAO integration/unit testing and local development
Sep 6, 2018 · 1 min read
In this small post, we will go through how to use embedded PostgreSQL in your local development environment plus how to use it for DAO integration/unit testing. If you have and are using PostgreSQL as your production database, your DAO testing should use the same database as your production one in order to have behavior consistency and the same environment precondition.
We will go through a sample Spring Boot application:
- The Spring Boot application dependencies
- DB configuration with embedded PostgreSQL for development
- Customer CRUD different layers with spring data, mapstruct, and lombok
- DAO unit testing with embedded PostgreSQL with custom data population on start
The whole details of the above points are covered in my blog post :https://mromeh.com/2018/09/03/spring-boot-with-embedded-postgresql-for-dao-integration-unit-testing-and-local-development/