Skip to content

ai-unified-process/aiup-spring-boot

v3.2.0

AI Unified Process Spring Boot layers - service and REST API implementation and tests

spring-rest

Implements the REST API layer of a use case (UC-XXX) in a Spring Boot application: @RestController endpoints on top of the service layer, request and response DTO records, @Valid input validation, error mapping to RFC 9457 Problem Details with a @RestControllerAdvice, a status code per alternative flow, and paging. Takes the base path and contract style from the API contract section of docs/architecture/stack.md; holds no business rule the service does not enforce. Use when the user asks to "build the REST API", "create an endpoint", "expose the use case over HTTP", "add a controller", "map errors to Problem Details", or mentions @RestController, @RequestMapping, DTOs, ProblemDetail, RFC 9457, status codes, or a JSON contract for a separate client such as Angular. Normally run by /use-case-implement after the service layer; it can also be run directly.

spring-rest-test

Writes the REST API tests of a use case (UC-XXX) in a Spring Boot application: status codes, Location headers, the JSON contract (field names, date formats), RFC 9457 Problem Details bodies, and — as the integration layer of a REST service or behind an Angular client — every business rule's allowed and rejected request at the boundary, through the real service and database. Uses MockMvcTester against the full stack or live HTTP with RestTestClient and Testcontainers, detecting and keeping a project's existing convention (including MockMvc or RestAssured) and asking before the first API test. Classes are named UC001<Name>ApiTest and every method carries @UseCase. Use when the user asks to "test the REST API", "test the controller", "test the endpoints", "write API tests", "check the status codes", or mentions MockMvc, MockMvcTester, RestTestClient, RestAssured, ProblemDetail tests, or Spring Boot web tests. Normally run by /use-case-test as the integration layer; it can also be run directly.

spring-service

Implements the service layer of a use case (UC-XXX) in a Spring Boot application: @Service classes with constructor injection, @Transactional boundaries, the business rules with UC-XXX BR-YYY markers, domain exceptions for every rejection the API or UI turns into a message, and Bean Validation on the inputs. Calls the persistence layer only through the repository or port its Handover names, and supports both a flat single module and a hexagonal multi-module layout (domain record, business service, outbound port). Use when the user asks to "implement the service layer", "write the business logic", "enforce the business rules", "create a Spring service", "add transactions", or mentions @Service, @Transactional, domain exceptions, or the business module of a hexagonal Spring Boot project. Normally run by /use-case-implement after the persistence layer; it can also be run directly.

spring-service-test

Writes the service layer tests of a use case (UC-XXX) in a Spring Boot application: every business rule with its allowed and its rejected case, every alternative flow the service decides, and the main success scenario, called on the @Service directly. Uses @SpringBootTest with the real persistence layer and a Testcontainers database, or plain unit tests with an in-memory fake of the outbound port in the business module of a hexagonal project. Classes are named UC001<Name>ServiceTest and every method carries @UseCase. Use when the user asks to "test the service layer", "test the business rules", "write service tests", "unit test the business logic", or mentions @SpringBootTest service tests, Testcontainers, domain exceptions, or business rule tests for a Spring Boot use case. Run by /use-case-test as the integration layer of a Hilla stack or a stack without an entry layer, or when the service layer is named; below a Vaadin Flow UI or a REST entry layer their tests cover the service. Can also be run directly.