Skip to content

Upgrade to Java 21 and Spring Boot 3.3.4 with test suite - #83

Open
devin-ai-integration[bot] wants to merge 2 commits into
masterfrom
devin/1789402277-java21-boot3
Open

devin-ai-integration[bot] wants to merge 2 commits into
masterfrom
devin/1789402277-java21-boot3

Conversation

@devin-ai-integration

Copy link
Copy Markdown

Summary

Upgrades the project from Java 8 / Spring Boot 2.0.2 to Java 21 / Spring Boot 3.3.4 (Maven and Gradle builds), adds a test suite (there was none), and gets it green: 18/18 tests pass on mvn test and ./gradlew test with JDK 21.

Baseline (before the upgrade)

  • <packaging>pom</packaging> in pom.xml meant mvn test never compiled or tested anything ("BUILD SUCCESS" in 0.1s). Switched to jar.
  • No src/test existed. Added 18 tests: @SpringBootTest context load, MockMvc tests for every endpoint (/, /datetime, /topic*, string/file operation endpoints), and TopicService unit tests.
  • Running that suite on JDK 21 against the old stack: 11/18 errored with
    InaccessibleObjectException: Unable to make protected final Class ClassLoader.defineClass(...) accessible: module java.base does not "opens java.lang" — Spring 5.0's bundled CGLIB is incompatible with the JDK 17+ module system.

Breaking changes handled

Area Change
Build (Maven) spring-boot-starter-parent 2.0.2.RELEASE → 3.3.4, java.version 1.8 → 21, packaging pom → jar, added spring-boot-starter-test, dropped spring-boot-properties-migrator (2.x-only tool).
Build (Gradle) Rewrote build.gradle from the removed compile/testCompile configurations and buildscript plugin style to plugins {} with Boot 3.3.4 + dependency-management 1.1.6, Java 21 toolchain, useJUnitPlatform(). Gradle wrapper 4.6 → 8.10.2 (Boot 3 requires Gradle 7.5+).
javax → jakarta Boot 3 / Spring 6 moved to Jakarta EE 9+ (jakarta.servlet, jakarta.annotation, jakarta.validation). Audited src/main — no javax.* imports exist in this codebase, so no source edits were needed; the transitive deps (Tomcat 10, Hibernate Validator 8) are now jakarta-based via the new parent.
JUnit 4 → 5 spring-boot-starter-test 3.x no longer ships JUnit 4 / SpringRunner. Tests use org.junit.jupiter.api.*, @BeforeEach, Assertions, and no @RunWith.
Deprecated API JdbcTemplate.query(String, Object[], RowMapper) (deprecated since Spring 5.3) → query(String, RowMapper, Object...).
H2 1.4 → 2.x DROP TABLE customers IF EXISTS is invalid in H2 2.x → DROP TABLE IF EXISTS customers; id SERIALid BIGINT GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY.
Dead startup dependency Application fetched a quote from gturnquist-quoters.cfapps.io (host no longer resolves) both in main() and in a CommandLineRunner; the unhandled ResourceAccessException aborted context startup, failing every @SpringBootTest. Removed the duplicate call in main(); the runner now catches RestClientException and logs a warning.
Repo hygiene Removed committed target/ classes; .gitignore now covers target/, build/, .gradle/.

Verification

  • JAVA_HOME=<jdk21> mvn clean testTests run: 18, Failures: 0, Errors: 0
  • ./gradlew clean test (Gradle 8.10.2, JDK 21) → passes
  • Packaged jar boots on JDK 21; /, /topic/sort respond and the H2 customer seeding logs the two "Josh" rows.

Devin-Org: engineering

Link to Devin session: https://app.devin.ai/sessions/2934197453df4790b15a19e52c27afa0
Open in Devin Desktop: https://app.devin.ai/desktop/session/2934197453df4790b15a19e52c27afa0?variant=devin
Requested by: @rushcromer


Note

Devin errored when opening this Pull Request as rushcromer.
As a fallback, Devin opened this PR as itself.

devin-ai-integration Bot and others added 2 commits September 14, 2026 16:12
Co-Authored-By: Rush Cromer II <rush.cromerii@cognition.ai>
…Unit 5, fix H2 2.x SQL and deprecated JdbcTemplate API

Co-Authored-By: Rush Cromer II <rush.cromerii@cognition.ai>
@devin-ai-integration

Copy link
Copy Markdown
Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

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.

0 participants