Upgrade to Java 25 and Spring Boot 3.5; modernize code#11
Open
devin-ai-integration[bot] wants to merge 2 commits into
Open
Upgrade to Java 25 and Spring Boot 3.5; modernize code#11devin-ai-integration[bot] wants to merge 2 commits into
devin-ai-integration[bot] wants to merge 2 commits into
Conversation
- Java 8 -> Java 25 (LTS), Spring Boot 2.0.2 -> 3.5.0 - Remove legacy Gradle config (keep Maven) - Drop obsolete spring-boot-properties-migrator - Add Spring Boot Actuator and springdoc-openapi - Convert DTOs to records (Topic, Greeting, Value, Customer, Quote) - Switch to specific HTTP mappings (@GetMapping/@PostMapping/...) - Constructor injection; RequestMapping base path on TopicController - Fix NPE in getTopicWithId: return Optional, 404 via ResponseStatusException - CopyOnWriteArrayList for thread-safe in-memory store; immutable getAllTopics - Remove dead gturnquist-quoters.cfapps.io REST call from Application - Guard JDBC CommandLineRunner with @ConditionalOnBean(JdbcTemplate.class) - Add JUnit 5 tests (TopicService + TopicController @WebMvcTest + context) - Add GitHub Actions CI on JDK 25 - Hygiene: expand .gitignore; remove IDE/.iml/target/.idea; refresh README Co-Authored-By: Bobby Nobakht <bobby.nobakht@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:
|
Co-Authored-By: Bobby Nobakht <bobby.nobakht@cognition.ai>
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 (2018) to Java 25 (LTS) / Spring Boot 3.5.0, and batches in a set of correctness, modernization, and hygiene improvements.
Build & dependencies
pom.xml: parentspring-boot-starter-parent2.0.2.RELEASE→3.5.0;<java.version>1.8→25;maven.compiler.release=25.spring-boot-properties-migrator(it was a 1.x→2.x aid).spring-boot-starter-actuator,spring-boot-starter-test,springdoc-openapi-starter-webmvc-ui(Swagger UI at/swagger-ui.html).build.gradle,gradle/,gradlew,gradlew.bat) — Maven is now the single build tool.org.springframework:gs-spring-boot:0.1.0 (pom)→hello:springboot-java-modern:1.0.0 (jar).Correctness / behavior
http://gturnquist-quoters.cfapps.io/api/randominApplication.mainand the oldCommandLineRunner(PWS was retired in 2023; this would fail on startup).TopicService.getTopicWithIdnow returnsOptional<Topic>; controller throwsResponseStatusException(NOT_FOUND)→ proper404instead of a 500NoSuchElementException.CommandLineRunnerwith@ConditionalOnBean(JdbcTemplate.class)so slice tests don't need aDataSource.ArrayListof topics withCopyOnWriteArrayListfor thread-safety;getAllTopics()returns an immutable copy.Modernization
record:Topic,Greeting,Quote,Value,Customer.@RequestMapping→@GetMapping/@PostMapping/@PutMapping/@DeleteMapping;@RequestMapping("/topic")hoisted to class level; constructor injection replaces@Autowiredfields;@ResponseStatuson create/delete.TopicServiceusesList.of, method references,Pattern#asMatchPredicate,Stream#toList.HelloControlleruses a text block +String#formatted.pom*/README.mdnow thatgrad*andtemp.txtno longer exist.Tests & CI
TopicServiceTest(11 unit tests),TopicControllerTest(5@WebMvcTestMockMvc tests),ApplicationTestscontext-load smoke test. Localmvn verify: 17/17 passing..github/workflows/ci.ymlrunning./mvnw -B -ntp verifyon Temurin JDK 25.Hygiene
.gitignore(target/,build/,.idea/,*.iml,.vscode/, …).target/,.idea/,gs-spring-boot.iml, stray.gitignore.txt, root-levelapplication.properties,temp.txt../mvnwcommands, Swagger/Actuator URLs).Review & Testing Checklist for Human
Topic— the model is now arecord, so Jackson serializesid/subjectName/subjectDescriptionvia record accessors. POST a topic and GET it back; the JSON field names should match the pre-PR shape (I did not find any consumers that relied onget*setters, but please double-check).javax.*usages were found in this codebase, but please skim the runtime logs after./mvnw spring-boot:runfor any deprecation/config-migration warnings./topic/file/operationnow searches forpom*instead ofgrad*and readsREADME.mdinstead of the deletedtemp.txt. Confirm that's acceptable (these are demo endpoints, not user-facing).groupId/artifactId/versionwent fromorg.springframework:gs-spring-boot:0.1.0tohello:springboot-java-modern:1.0.0. Confirm nothing external consumes the published artifact under the old coords.actions/setup-java; verify the runner has it available (this is new enough that it's worth a sanity check on the first green run).Notes
topicslist with JPA + H2 (the deps are already pulled in), containerize with aDockerfile/buildpacks, Micrometer/Prometheus observability.Link to Devin session: https://app.devin.ai/sessions/36c4f507879e4903a73800cd780af6bd
Requested by: @bnob-git