This is a simple REST API application made in Spring Boot.
It uses REST Controllers to handle HTTP requests and provide a web interface for the application, which were used intentionally for learning purposes.
Application uses PostgreSQL running on Docker as main database and H2 Memory Database for tests.
The project implements a full web layer consisting of Controllers, Services, and DTOs (Data Transfer Objects) for Author and Book entities.
- Controllers: Located in
src/main/java/com.candyy.postgres/controllers, handling HTTP endpoints. - Services: Located in
src/main/java/com.candyy.postgres/services, containing business logic. - DTOs: Located in
src/main/java/com.candyy.postgres/domain/dto, used for data mapping between layers. - Mappers: Located in
src/main/java/com.candyy.postgres/mappers, facilitating conversion between Entities and DTOs.
The application includes comprehensive integration tests for all REST endpoints to ensure correct CRUD functionality over HTTP.
Tests are placed in src/test/java/com.candyy.postgres/controllers directory.
The test suite covers:
- Creation and full/partial updates of resources.
- Retrieval of single resources and paginated lists.
- Deletion of resources.
- Verification of HTTP status codes and JSON response bodies.
Project uses Spring Web, Spring Data JPA, ModelMapper, PostgreSQL, and Lombok.