You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .github/copilot-instructions.md
+12-17Lines changed: 12 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
3
3
## Project Overview
4
4
5
-
This is a RESTful Web Service proof-of-concept built with **Spring Boot 3** targeting **JDK 21 (LTS)**. The application demonstrates a clean, layered architecture implementing a CRUD API for managing books. It uses an in-memory H2 database for data persistence and includes comprehensive test coverage.
5
+
This is a RESTful Web Service proof-of-concept built with **Spring Boot 4** targeting **JDK 25 (LTS)**. The application demonstrates a clean, layered architecture implementing a CRUD API for managing books. It uses an in-memory H2 database for data persistence and includes comprehensive test coverage.
6
6
7
7
**Key URLs:**
8
8
@@ -14,8 +14,8 @@ This is a RESTful Web Service proof-of-concept built with **Spring Boot 3** targ
14
14
15
15
### Core Framework & Runtime
16
16
17
-
-**Java**: JDK 21 (LTS) - use modern Java features where appropriate
18
-
-**Spring Boot**: 3.4.4 with starter dependencies (Web, Data JPA, Validation, Cache, Actuator)
17
+
-**Java**: JDK 25 (LTS) - use modern Java features where appropriate
18
+
-**Spring Boot**: 4.0.0 with modular starter dependencies (WebMVC, Data JPA, Validation, Cache, Actuator)
19
19
-**Build Tool**: Maven 3.9+ (use `./mvnw` wrapper, NOT system Maven)
-**Assertions**: Use AssertJ fluent assertions (`assertThat(...).isEqualTo(...)`)
101
-
-**Mocking**: Use `@MockBean` for Spring beans, verify interactions with `verify()`
100
+
-**Mocking**: Use `@MockitoBean` for Spring beans (new in Spring Boot 4.0), verify interactions with `verify()`
102
101
-**Test Data**: Use fake data factories (`BookFakes`, `BookDTOFakes`) for consistent test data
103
102
-**Display Names**: Use `@DisplayName` for readable test descriptions
103
+
-**Caching in Tests**: Add `@AutoConfigureCache` to slice tests (`@WebMvcTest`, `@DataJpaTest`) when caching is needed
104
104
105
105
### Coverage Exclusions
106
106
@@ -137,8 +137,8 @@ JaCoCo excludes from coverage (see `pom.xml` and `codecov.yml`):
137
137
**Critical Requirements**:
138
138
139
139
-**ALWAYS use `./mvnw` wrapper** (Unix/macOS) or `mvnw.cmd` (Windows), NOT `mvn`
140
-
-**JDK 21 is REQUIRED**: The project targets JDK 21 (LTS). Using newer JDKs (22+) will cause Mockito/ByteBuddy compatibility issues in tests
141
-
-**JAVA_HOME must be set**: Maven wrapper requires JAVA_HOME pointing to JDK 21 installation
140
+
-**JDK 25 is REQUIRED**: The project targets JDK 25 (LTS)
141
+
-**JAVA_HOME must be set**: Maven wrapper requires JAVA_HOME pointing to JDK 25 installation
142
142
143
143
### Docker Commands
144
144
@@ -205,8 +205,8 @@ docker compose logs -f
205
205
-**Lombok not working**: Ensure annotation processor is enabled in IDE and `maven-compiler-plugin` includes Lombok path
206
206
-**Tests failing**: Check if H2 database is properly initialized; review `BooksDataInitializer.seed()`
207
207
-**Port already in use**: Change `server.port` in `application.properties` or kill process using ports 9000/9001
208
-
-**JAVA_HOME not set**: Run `export JAVA_HOME=$(/usr/libexec/java_home -v 21)` on macOS or set to JDK 21 path on other systems
209
-
-**JDK version errors**: Project requires JDK 21 (LTS). Using JDK 22+ causes Mockito/ByteBuddy failures like "Java 25 (69) is not supported"
208
+
-**JAVA_HOME not set**: Run `export JAVA_HOME=$(/usr/libexec/java_home -v 25)` on macOS or set to JDK 25 path on other systems
209
+
-**CacheManager errors in tests**: Add `@AutoConfigureCache` annotation to slice tests (`@WebMvcTest`, `@DataJpaTest`)
210
210
211
211
### Docker Issues
212
212
@@ -216,10 +216,10 @@ docker compose logs -f
216
216
### Common Pitfalls
217
217
218
218
-**Don't use system Maven**: Always use `./mvnw` wrapper
219
-
-**Don't use newer JDKs**: Stick to JDK 21 - newer versions break Mockito in tests
220
219
-**Don't modify `Application.java` coverage**: It's excluded by design
221
220
-**Don't test Lombok-generated code**: Focus on business logic
222
221
-**Repository interfaces**: Custom query methods may not show in coverage (JaCoCo limitation)
222
+
-**Spring Boot 4.0 modular packages**: Test annotations like `@WebMvcTest`, `@DataJpaTest`, and `@AutoConfigureCache` are now in modular packages (e.g., `org.springframework.boot.webmvc.test.autoconfigure.WebMvcTest`)
223
223
224
224
## CI/CD Pipeline
225
225
@@ -235,11 +235,6 @@ docker compose logs -f
235
235
-`CODACY_PROJECT_TOKEN`: Codacy integration token
236
236
-`GITHUB_TOKEN`: Automatically provided for GHCR push
237
237
238
-
### Azure Pipelines (`azure-pipelines.yml`)
239
-
240
-
- Runs on `ubuntu-latest` with JDK 21
241
-
- Executes `mvn package` and publishes test results
> A production-ready RESTful Web Service demonstrating clean architecture patterns with Spring Boot 3, comprehensive testing, and containerized deployment.
10
+
> A production-ready RESTful Web Service demonstrating clean architecture patterns with Spring Boot 4, comprehensive testing, and containerized deployment.
11
11
12
12
## Table of Contents
13
13
@@ -26,7 +26,7 @@
26
26
27
27
## About
28
28
29
-
A proof-of-concept RESTful Web Service built with **Spring Boot 3** targeting **JDK 21 (LTS)**. This project demonstrates best practices for building a layered, testable, and maintainable API implementing CRUD operations for a Books resource.
29
+
A proof-of-concept RESTful Web Service built with **Spring Boot 4** targeting **JDK 25 (LTS)**. This project demonstrates best practices for building a layered, testable, and maintainable API implementing CRUD operations for a Books resource.
30
30
31
31
The service showcases:
32
32
@@ -48,7 +48,7 @@ The service showcases:
48
48
- ✅ **Health Monitoring** - Spring Boot Actuator endpoints
49
49
- ✅ **Test Coverage** - JaCoCo reports with Codecov/Codacy integration
0 commit comments