Skip to content

Spring upgrade org.springframework.boot from 3.3.6 to 3.5.7#9253

Merged
kevinfiol merged 13 commits into
mainfrom
kf/upgrade-spring-boot-354
Nov 10, 2025
Merged

Spring upgrade org.springframework.boot from 3.3.6 to 3.5.7#9253
kevinfiol merged 13 commits into
mainfrom
kf/upgrade-spring-boot-354

Conversation

@kevinfiol
Copy link
Copy Markdown
Collaborator

@kevinfiol kevinfiol commented Oct 30, 2025

BACKEND PULL REQUEST

Related Issue

Resolves #9081

Stay up to date with the latest dependencies to ensure strong security and paying down tech debt

Changes Proposed

Additional Information

spring-boot-starter-test through org.skyscreamer:jsonassert:1.5.3 depends on com.vaadin.external.google:android-json, which seems like a version of org.json that was extracted from Android for general use.

We explicitly depend on org.json:json:20250517, which results in this warning when running tests:

Found multiple occurrences of org.json.JSONObject on the class path:

	jar:file:/home/kevin/.gradle/caches/modules-2/files-2.1/org.json/json/20250517/d67181bbd819ccceb929b580a4e2fcb0c8b17cd8/json-20250517.jar!/org/json/JSONObject.class
	jar:file:/home/kevin/.gradle/caches/modules-2/files-2.1/com.vaadin.external.google/android-json/0.0.20131108.vaadin1/fa26d351fe62a6a17f5cda1287c1c6110dec413f/android-json-0.0.20131108.vaadin1.jar!/org/json/JSONObject.class

The story seems to be that org.json at one point had an ambiguous license with the restriction "The software shall be used for good, not evil.". So JSONAssert and other framework authors moved away from org.json. However, since 2023, org.json removed that license and simply claims "Public Domain". Now it's just a matter of time until spring-boot-starter-test updates to JSONAssert 2.0, which re-includes org.json.

TLDR: We don't need to do anything here.

See:
spring-projects/spring-boot#41201
spring-projects/spring-boot#47385
skyscreamer/JSONassert#194

Testing

  • Run ./gradlew clean && ./gradlew build --refresh-dependencies locally
  • Run backend tests locally

@kevinfiol kevinfiol marked this pull request as ready for review November 6, 2025 15:38
@kevinfiol kevinfiol requested review from a team as code owners November 6, 2025 15:38
@kevinfiol kevinfiol requested review from DanielSass, DavidMcClatchey, mpbrown and schreiaj and removed request for a team November 6, 2025 15:39
@kevinfiol kevinfiol changed the title Spring upgrade org.springframework.boot from 3.3.6 to 3.5.4 Spring upgrade org.springframework.boot from 3.3.6 to 3.5.7 Nov 6, 2025
Comment on lines +103 to +108
liquibase.setContexts(StringUtils.collectionToCommaDelimitedString(properties.getContexts()));
liquibase.setDataSource(dataSource);
liquibase.setDefaultSchema(properties.getDefaultSchema());
liquibase.setDropFirst(properties.isDropFirst());
liquibase.setLabelFilter(properties.getLabelFilter());
liquibase.setLabelFilter(
StringUtils.collectionToCommaDelimitedString(properties.getLabelFilter()));
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These now only take in a string, which can accept a CSV liquibase/liquibase#6534

schreiaj
schreiaj previously approved these changes Nov 7, 2025
Copy link
Copy Markdown
Contributor

@schreiaj schreiaj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would like to see clarification about why the changes in backend/src/test/java/gov/cdc/usds/simplereport/integration/SubmitTestResultIntegrationTest.java and backend/src/test/java/gov/cdc/usds/simplereport/integration/SubmitTestResultTestConfig.java were made here in the PR, but otherwise LGTM.


@Test
void complete_submit_test_result_flow() throws IOException {
Date date = Date.from(Instant.parse("2023-05-24T19:33:06.472Z"));
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What prompted this change? This seems to be new logic in a test or at least moving it from another file?

Copy link
Copy Markdown
Collaborator Author

@kevinfiol kevinfiol Nov 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, this was moved from SubmitTestResultTestConfig.java in order to use MockitoBeans and to fix this failing test.

Someone with more Java/Mockito/Bean knowledge may be able to explain this better, but from my understanding: MockitoBeans behave slightly differently from MockBeans in that setting dateGenerator and uuidGenerator as MockitoBeans in the test config would not initialize them on time for when the fhirQueueReportingService Bean is finally used by this test. As a result, this test would fail because the dateGenerator and uuidGenerator would be null when they are called further down the call stack.

The work around is to set and initialize them locally in the test case, and pass them to fhirQueueReportingService when it's finally called.

DavidMcClatchey
DavidMcClatchey previously approved these changes Nov 7, 2025
Copy link
Copy Markdown
Collaborator

@DavidMcClatchey DavidMcClatchey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - the code, tests, and build+run 🚀 🚀 🚀

Comment thread backend/gradle/wrapper/gradle-wrapper.properties
Comment thread backend/build.gradle
Comment on lines +145 to 150
testImplementation 'org.mockito:mockito-core'
testImplementation 'org.mockito:mockito-junit-jupiter'
testImplementation 'org.junit.jupiter:junit-jupiter'
testImplementation 'com.fasterxml.jackson.core:jackson-databind'

// used to autoconfigure WireMock for testing
Copy link
Copy Markdown
Collaborator

@DanielSass DanielSass Nov 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we're we not pulling in mockito explicitly before?
edit: I guess this is a stupid question

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I remember correctly, there was a change in transitive dependencies in spring-boot-starter-test between upgrades that required this.

DanielSass
DanielSass previously approved these changes Nov 10, 2025
Copy link
Copy Markdown
Collaborator

@DanielSass DanielSass left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

@kevinfiol kevinfiol dismissed stale reviews from DanielSass and DavidMcClatchey via e28b370 November 10, 2025 17:19
@DavidMcClatchey
Copy link
Copy Markdown
Collaborator

I think we could add the Resolves tag for this one too if we're including the latest from gradle: #9245

@DanielSass
Copy link
Copy Markdown
Collaborator

re: upgrading gradle

It looks like the jump to 9.x is breaking. I would be more comfortable if we highest version of 8.x and address upgrading gradle in a separate PR (regardless of the breaking build)

@sonarqubecloud
Copy link
Copy Markdown

Copy link
Copy Markdown
Collaborator

@DanielSass DanielSass left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚢 :shipit:

@kevinfiol kevinfiol added this pull request to the merge queue Nov 10, 2025
Merged via the queue into main with commit 289ff9b Nov 10, 2025
35 checks passed
@kevinfiol kevinfiol deleted the kf/upgrade-spring-boot-354 branch November 10, 2025 18:54
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.

Spring upgrade org.springframework.boot from 3.3.6 to 3.5.7

4 participants