-
Notifications
You must be signed in to change notification settings - Fork 6
Issue 46 upgrade to spring boot 4 #47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- Upgrade Spring Boot from 3.5.6 to 4.0.0 - Upgrade Java toolchain from 17 to 21 (required for Spring Boot 4) - Add Spring Boot 4 modular test dependencies: - spring-boot-data-jpa-test - spring-boot-webmvc-test - spring-boot-starter-security-test - Update ds-spring-user-framework to 4.0.0-SNAPSHOT - Remove deprecated launchScript from bootJar (removed in Spring Boot 4) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Spring Security 7 strictly enforces that all URL patterns must start
with '/'. The unprotectedURIs property had 'error.htmla' at the end
which was:
1. Missing the leading '/'
2. Had a typo ('htmla' instead of 'html')
Changed to '/error,/error.html' to properly allow error pages.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Spring Boot 4 moved test annotations to separate modules with new package locations. Updated all test files to use: - @AutoConfigureMockMvc -> boot.webmvc.test.autoconfigure - @WebMvcTest -> boot.webmvc.test.autoconfigure - @DataJpaTest -> boot.data.jpa.test.autoconfigure - @MockitoBean -> test.context.bean.override.mockito Also updated ObjectMapper instantiation to manual creation since Jackson 3 (used in Spring Boot 4) changed auto-configuration behavior. Files updated across: - demo/event tests - user/api tests - user/concurrent tests - user/integration tests - user/oauth2 tests - user/security tests - test annotations 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Pull Request Review: Spring Boot 4.0.0 UpgradeI've completed a comprehensive review of this PR. Overall, this is a well-executed major version upgrade with clear documentation and systematic changes. Here's my detailed feedback: ✅ Strengths
🔍 Code Quality & Best PracticesDependencies (build.gradle)
Test Updates
Configuration
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR upgrades the Demo Application to Spring Boot 4.0.0 and Spring User Framework 4.0.0, bringing compatibility with Spring Security 7 and Java 21. The upgrade involves systematic updates to dependencies, test infrastructure, and configuration to align with the new framework versions' requirements.
Key Changes:
- Upgraded core dependencies (Spring Boot 3.5.x → 4.0.0, Spring User Framework 3.5.x → 4.0.0, Java 17 → 21)
- Migrated test annotations to new Spring Boot 4 package structure (webmvc, data.jpa, and persistence packages)
- Fixed Spring Security 7 URL pattern requirements and configuration typo in application.yml
- Standardized ObjectMapper instantiation in tests with explicit JavaTimeModule registration
- Added modular test starters and updated build configuration
Reviewed changes
Copilot reviewed 29 out of 30 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| build.gradle | Upgraded Spring Boot to 4.0.0, Java to 21, added modular test dependencies, removed deprecated launchScript configuration |
| src/main/resources/application.yml | Fixed typo (error.htmla) and added leading slashes to error URIs for Spring Security 7 compliance |
| src/test/java/com/digitalsanctuary/spring/user/test/annotations/IntegrationTest.java | Updated test annotation imports to Spring Boot 4 package structure |
| src/test/java/com/digitalsanctuary/spring/user/test/annotations/IntegrationTestNoTx.java | Updated test annotation imports to Spring Boot 4 package structure |
| src/test/java/com/digitalsanctuary/spring/user/UserApplicationTests.java | Migrated EntityScan import to new persistence package |
| src/test/java/com/digitalsanctuary/spring/demo/DemoTests.java | Migrated EntityScan import to new persistence package |
| src/test/java/com/digitalsanctuary/spring/demo/event/EventRepositoryTest.java | Updated EntityScan and DataJpaTest imports to Spring Boot 4 packages |
| src/test/java/com/digitalsanctuary/spring/demo/event/EventControllerTest.java | Updated WebMvcTest import and changed ObjectMapper to manual instantiation with JavaTimeModule |
| src/test/java/com/digitalsanctuary/spring/demo/event/EventAPIControllerTest.java | Updated WebMvcTest import and changed ObjectMapper to manual instantiation with JavaTimeModule |
| src/test/java/com/digitalsanctuary/spring/user/security/*.java (4 files) | Updated AutoConfigureMockMvc imports to new webmvc.test package |
| src/test/java/com/digitalsanctuary/spring/user/oauth2/GoogleOAuth2IntegrationTest.java | Updated AutoConfigureMockMvc import to new webmvc.test package |
| src/test/java/com/digitalsanctuary/spring/user/integration/SecurityConfigurationTest.java | Updated AutoConfigureMockMvc import and changed redirectedUrlPattern to redirectedUrl for precise assertion |
| src/test/java/com/digitalsanctuary/spring/user/integration/AuthenticationIntegrationTest.java | Updated AutoConfigureMockMvc import to new webmvc.test package |
| src/test/java/com/digitalsanctuary/spring/user/concurrent/*.java (2 files) | Updated AutoConfigureMockMvc imports to new webmvc.test package |
| src/test/java/com/digitalsanctuary/spring/user/api/*.java (13 files) | Updated AutoConfigureMockMvc imports and standardized ObjectMapper instantiation with JavaTimeModule across all API test files |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Summary
Upgrades the Demo Application to Spring Boot 4.0.0 and Spring User Framework 4.0.0, bringing compatibility with Spring Security 7 and Java 21.
Changes
Dependencies
Configuration Fixes
Test Updates
Build Configuration
Breaking Changes
Testing
Related
Checklist