This project is a CRUD-based RESTful web service for managing a collection of games using Jakarta EE 11 preview.
Additional featuers include filtering and pagination.
Unit tests for service and mapper classes.
ArchUnit ArchitectureTest.
RestAssured API tests for REST-endpoints.
Dockerfile for the application, plus Docker Compose configuration with a database.
-
Jakarta EE 11 Preview
- Jakarta Data (jakarta.data-api:1.0.1)
- Jakarta Persistence (jakarta.persistence-api)
- Jakarta Bean Validation (jakarta.validation-api)
-
Maven
-
Docker
-
PostgreSQL
Game entity (JPA)
DTOs:
CreateGame, UpdateGame, and GameResponse for incoming/outgoing data.
Repository:
GameRepository extends CrudRepository, also custom queries.
Service:
GameService enforces business rules and validation checks.
Mapper: Converts between Game and DTO objects.
REST Resource:
Exposes endpoints for create, read, update, delete, and filtering.
id (auto-generated)
title
release
publisher
description (optional)
genres
price
At least one genre is mandatory.
The combination of title, release, and publisher must be unique.
- Ordered by release: e.g., /api/games/release
- By publisher: e.g., /api/games/publisher/Nintendo
☞ Make sure you have Docker and Docker Compose installed
☞ To build and run outside of Docker you need Java23 and Maven installed
- Clone respository
git clone https://github.com/malvamalmgren/jee2025.git - Locate root folder
cd jee2025 - Run services in docker-compose.yaml
docker-compose up --build - Make sure containers are running
docker ps - Check it out at:
http://localhost:8080/api/games