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
Open
devin-ai-integration[bot] wants to merge 2 commits into
devin-ai-integration[bot] wants to merge 2 commits into
Conversation
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>
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 testand./gradlew testwith JDK 21.Baseline (before the upgrade)
<packaging>pom</packaging>inpom.xmlmeantmvn testnever compiled or tested anything ("BUILD SUCCESS" in 0.1s). Switched tojar.src/testexisted. Added 18 tests:@SpringBootTestcontext load, MockMvc tests for every endpoint (/,/datetime,/topic*, string/file operation endpoints), andTopicServiceunit tests.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
spring-boot-starter-parent2.0.2.RELEASE → 3.3.4,java.version1.8 → 21,packagingpom → jar, addedspring-boot-starter-test, droppedspring-boot-properties-migrator(2.x-only tool).build.gradlefrom the removedcompile/testCompileconfigurations andbuildscriptplugin style toplugins {}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+).jakarta.servlet,jakarta.annotation,jakarta.validation). Auditedsrc/main— nojavax.*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.spring-boot-starter-test3.x no longer ships JUnit 4 /SpringRunner. Tests useorg.junit.jupiter.api.*,@BeforeEach,Assertions, and no@RunWith.JdbcTemplate.query(String, Object[], RowMapper)(deprecated since Spring 5.3) →query(String, RowMapper, Object...).DROP TABLE customers IF EXISTSis invalid in H2 2.x →DROP TABLE IF EXISTS customers;id SERIAL→id BIGINT GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY.Applicationfetched a quote fromgturnquist-quoters.cfapps.io(host no longer resolves) both inmain()and in aCommandLineRunner; the unhandledResourceAccessExceptionaborted context startup, failing every@SpringBootTest. Removed the duplicate call inmain(); the runner now catchesRestClientExceptionand logs a warning.target/classes;.gitignorenow coverstarget/,build/,.gradle/.Verification
JAVA_HOME=<jdk21> mvn clean test→Tests run: 18, Failures: 0, Errors: 0./gradlew clean test(Gradle 8.10.2, JDK 21) → passes/,/topic/sortrespond 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.