Skip to content

UC-01: Player Management Service - Implementation Summary#4

Merged
jwellniak merged 3 commits into
mainfrom
feature/player
Oct 24, 2025
Merged

UC-01: Player Management Service - Implementation Summary#4
jwellniak merged 3 commits into
mainfrom
feature/player

Conversation

@jwellniak
Copy link
Copy Markdown
Collaborator

No description provided.

Joern Wellniak and others added 3 commits October 23, 2025 15:35
…, OpenAPI documentation, and Flyway migrations (#3)

* Initial plan

* Add entities, repositories, DTOs, service and controller for player management

Co-authored-by: jwellniak <87517644+jwellniak@users.noreply.github.com>

* Add integration tests and fix parameter binding issue

Co-authored-by: jwellniak <87517644+jwellniak@users.noreply.github.com>

* Add unit tests for PlayersService with Mockito

Co-authored-by: jwellniak <87517644+jwellniak@users.noreply.github.com>

* Add implementation summary document for UC-01

Co-authored-by: jwellniak <87517644+jwellniak@users.noreply.github.com>

* ADR

* Refactor according to ADR-004, ADR-005, and ADR-007

- Add Lombok dependency and use @DaTa, @NoArgsConstructor, @AllArgsConstructor for entities
- Change PlayerRepository to return List<PlayerEntity> instead of Object[]
- Add findLatestScoresForPlayers method to PlayerScoreRepository
- Refactor PlayersServiceImpl to use @Autowired on private members instead of constructor injection
- Update listPlayers to fetch entities first, then load scores separately as per ADR-005
- Update PlayersController to use @Autowired on private members
- Update unit tests to match new repository methods

Co-authored-by: jwellniak <87517644+jwellniak@users.noreply.github.com>

* ADR

* Apply ADR-006 (var) and ADR-008 (TestRestTemplate)

- Replace explicit type declarations with var throughout PlayersServiceImpl as per ADR-006
- Replace @MockMvc with TestRestTemplate in PlayersControllerIT as per ADR-008
- Update integration tests to use @SpringBootTest with RANDOM_PORT and TestRestTemplate
- Convert all test assertions to use AssertJ instead of jsonPath matchers
- All 35 tests still passing (16 unit + 19 integration)

Co-authored-by: jwellniak <87517644+jwellniak@users.noreply.github.com>

* Cleanup

* ADR

* Add OpenAPI/Swagger annotations as per ADR-010

- Add springdoc-openapi-starter-webmvc-ui dependency (version 2.1.0)
- Annotate PlayersController with @tag for API grouping
- Add @operation annotations with summaries and descriptions for all endpoints
- Add @ApiResponses documenting all response codes (200, 201, 204, 400, 404, 409)
- Add @parameter annotations with descriptions and examples
- Swagger UI automatically available at /swagger-ui.html
- OpenAPI spec available at /v3/api-docs
- All 35 tests still passing

Co-authored-by: jwellniak <87517644+jwellniak@users.noreply.github.com>

* ADR

* Add Flyway migrations and Testcontainers configuration per ADR-011 and ADR-012

- Add Flyway dependencies (flyway-core and flyway-database-postgresql)
- Add spring-boot-testcontainers dependency for @Serviceconnection support
- Configure Flyway in application.properties (enabled, baseline-on-migrate)
- Change JPA ddl-auto from 'update' to 'none' (Flyway manages schema now)
- Create Flyway migration scripts:
  - V1__Create_player_table.sql with indexes and constraints
  - V2__Create_game_table.sql with foreign keys and indexes
  - V3__Create_player_score_table.sql with indexes
- Create PostgresTestcontainersConfig for integration tests
- Create application-test.properties with Flyway enabled
- Update PlayersControllerIT to use @import(PostgresTestcontainersConfig.class) and @activeprofiles("test")
- Remove manual container configuration from tests
- All 35 tests passing (16 unit + 19 integration)

Co-authored-by: jwellniak <87517644+jwellniak@users.noreply.github.com>

* ADR, Swagger

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: jwellniak <87517644+jwellniak@users.noreply.github.com>
Co-authored-by: Joern Wellniak <joern.wellniak@partner.bmw.de>
@jwellniak jwellniak merged commit bd85b7c into main Oct 24, 2025
2 checks passed
@jwellniak jwellniak deleted the feature/player branch October 24, 2025 08:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants