Skip to content

chore: Complete Spring Boot 4.x migration - #50

Open
pacphi wants to merge 2 commits into
masterfrom
feature/spring-boot-4-migration
Open

chore: Complete Spring Boot 4.x migration#50
pacphi wants to merge 2 commits into
masterfrom
feature/spring-boot-4-migration

Conversation

@pacphi

@pacphi pacphi commented Jan 4, 2026

Copy link
Copy Markdown
Owner

Summary

This PR completes the migration to Spring Boot 4.0.1 with all required build configuration and code updates to address breaking changes in Spring Framework 6.2 and Spring Boot 4.x.

Changes

Build Configuration

  • Migrated from legacy buildscript to modern Gradle plugins DSL
  • Added Spring Boot 4.0.1 plugin
  • Added dependency-management plugin 1.1.7
  • Updated Java compatibility to version 25
  • Added Jackson BOM 3.0.2 for Jackson 3.x support
  • Fixed R2DBC PostgreSQL dependency (org.postgresql:r2dbc-postgresql)
  • Added JUnit Platform test configuration

Code Changes

Spring Framework 6.2 Breaking Changes

Fixed: ServerRequest.methodName() removed in Spring Framework 6.2

Updated in PersonHandler.java (3 methods):

// Before
request.methodName()

// After  
request.method().name()

JUnit 4 → JUnit 5 Migration

Migrated ReactiveJdbcDemoApplicationTests.java:

  • Removed @RunWith(SpringRunner.class)
  • Updated imports to JUnit 5 (org.junit.jupiter.api.Test)
  • Updated method visibility (JUnit 5 conventions)

Validation

  • ✅ Clean build: PASSED
  • ✅ All tests: PASSED
  • ✅ Dependencies verified: Jackson 3.0.2 (tools.jackson.core)

Test Plan

  • Run full build with tests
  • Verify compilation
  • Test with PostgreSQL container
  • Validate R2DBC reactive queries
  • Test WebFlux endpoints

Files Modified

  • build.gradle - Build system modernization
  • src/main/java/.../PersonHandler.java - Spring Framework 6.2 API updates
  • src/test/java/.../ReactiveJdbcDemoApplicationTests.java - JUnit 5 migration

🤖 Generated with Claude Code

pacphi and others added 2 commits January 4, 2026 07:29
- Upgrade Spring Boot from 4.0.0 to 4.0.1
- Upgrade Java from 8 to 21
- Update Gradle wrapper from 6.1.1 to 9.1
- Migrate from deprecated reactive-pg-client to Spring Data R2DBC
- Implement ReactiveCrudRepository pattern for cleaner data access
- Add Spring Data annotations to Person entity (@table, @id, @column)
- Replace deprecated BodyInserters.fromObject() with fromValue()
- Update application.yml with R2DBC configuration
- Remove obsolete PgSettings and manual connection handling
- Upgrade test framework to Testcontainers
- Comprehensively update README with R2DBC migration notes and updated instructions

Benefits of R2DBC migration:
- Standard Spring Data repository interfaces
- Automatic connection pool management
- Better error handling and transaction support
- Active community and long-term support

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 (1M context) <noreply@anthropic.com>
This commit completes the migration to Spring Boot 4.0.1 with all required
build configuration and code updates.

Build Configuration Changes:
- Migrated from buildscript to modern Gradle plugins DSL
- Added Spring Boot 4.0.1 plugin
- Added dependency-management plugin 1.1.7
- Updated Java compatibility to version 25
- Added Jackson BOM 3.0.2 for Jackson 3.x support
- Fixed R2DBC PostgreSQL dependency (org.postgresql:r2dbc-postgresql)
- Added JUnit Platform test configuration

Code Changes:
- Updated ServerRequest.methodName() to method().name() in PersonHandler
  (Breaking change in Spring Framework 6.2/Spring Boot 4.x)
- Migrated test from JUnit 4 to JUnit 5
  - Changed from @RunWith(SpringRunner.class) to native JUnit 5
  - Updated @test import to org.junit.jupiter.api.Test
  - Removed deprecated SpringRunner and RunWith annotations

Validation:
- Clean build: PASSED
- Unit tests: PASSED
- Dependencies verified: Jackson 3.0.2 (tools.jackson.core)

Generated with Claude Code
Co-Authored-By: Claude Sonnet 4.5 (1M context) <noreply@anthropic.com>
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.

1 participant