Upgrade Java 17 to Java 21 LTS with MVP Test Coverage by devin-ai-integration[bot] · Pull Request #15 · jack-killian/Deere_OperationsCenterAPI-OAuth2-Java · GitHub
Skip to content

Upgrade Java 17 to Java 21 LTS with MVP Test Coverage#15

Closed
devin-ai-integration[bot] wants to merge 1 commit into
masterfrom
devin/1768919836-java21-upgrade-with-tests
Closed

Upgrade Java 17 to Java 21 LTS with MVP Test Coverage#15
devin-ai-integration[bot] wants to merge 1 commit into
masterfrom
devin/1768919836-java21-upgrade-with-tests

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Jan 20, 2026

Copy link
Copy Markdown

Summary

This PR upgrades the application from Java 17 to Java 21 LTS and adds MVP test coverage. The project previously had no test files.

Changes:

  • Updated Maven compiler plugin to target Java 21 (added explicit version 3.11.0)
  • Added maven-surefire-plugin 3.1.2 for JUnit 5 support
  • Added JUnit Jupiter 5.10.0 and Mockito 5.5.0 test dependencies
  • Created ApplicationTest.java with 4 tests covering renderError(), OAuth callback error handling, and index rendering
  • Created SettingsTest.java with 9 tests covering token management, configuration, and helper methods

Note: The task requested upgrading maven-shade-plugin to 4.0.0, but that version does not exist in Maven Central. The plugin remains at 3.6.0, which is compatible with Java 21.

Local Testing

The application was tested locally with Java 21.0.9 and runs successfully on port 9090:

App running on Java 21

Review & Testing Checklist for Human

  • CRITICAL: Update CI workflow - The .github/workflows/maven.yml still uses JDK 17.0.5+8. CI will fail until this is updated to Java 21. This was not in scope but is required for the PR to pass CI.
  • Verify Java 21 is acceptable for your deployment environment
  • Review the reflection-based testing in ApplicationTest.java (lines 42-48, 62-63, 78-79) - this accesses private methods which is acceptable for MVP but may be fragile
  • Run mvn clean package locally with Java 21 to verify the fat JAR builds correctly
  • Optionally test the OAuth2 flow by running java -jar target/oauth2-example-1.0.jar on port 9090

Notes

  • All 13 tests pass locally with Java 21.0.9
  • The shade plugin produces the fat JAR successfully with expected warnings about overlapping resources (pre-existing behavior)
  • CI is expected to fail until the workflow file is updated to use Java 21

Link to Devin run: https://app.devin.ai/sessions/5db90e70586c42dfa91812408167bbcf
Requested by: @jack-killian

- Update Maven compiler plugin to Java 21 (source and target)
- Add maven-compiler-plugin version 3.11.0
- Add maven-surefire-plugin 3.1.2 for JUnit 5 support
- Add JUnit Jupiter 5.10.0 and Mockito 5.5.0 test dependencies
- Create test infrastructure (src/test/java and src/test/resources)
- Add ApplicationTest with tests for renderError, OAuth callback error handling
- Add SettingsTest with tests for populate, getBasicAuthHeader, updateTokenInfo

Note: maven-shade-plugin kept at 3.6.0 (version 4.0.0 does not exist in Maven Central)
Co-Authored-By: Jack <jack.l.killian@gmail.com>
@devin-ai-integration

Copy link
Copy Markdown
Author

@devin-ai-integration

Copy link
Copy Markdown
Author

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