Repository navigation
Fix the Java test classpath — main is currently red - #6
Merged
Merged
Conversation
main was red: every test source failed to compile. - com.fasterxml.jackson.databind is absent from Spring Boot 4's webmvc starter, and the tests read responses as a JsonNode. Added as a test dependency, version managed by the Boot BOM. - org.springframework.boot.test.autoconfigure.web.servlet no longer exists under that name, so @AutoConfigureMockMvc and MockMvc could not resolve. OrderApiTest now starts the application on a random port with @SpringBootTest(webEnvironment = RANDOM_PORT) and drives it over real HTTP with the JDK client. It asserts the same six behaviours and no longer depends on any test-autoconfiguration package, which also brings it in line with how the other three starters test. Keeps the CI step that echoes Maven errors and surefire reports as annotations: it costs nothing on a green build and saves a log download on a red one. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017dJtYEDWbTTGw5wfTZ4nPX
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.
maindoes not compile its tests. CI caught it the moment Actions was enabled — exactly the failure the PR description warned about when I shipped the Java branch unbuilt.What was broken
Two Spring Boot 4 differences I could not see without a working build:
com.fasterxml.jackson.databindis not pulled in byspring-boot-starter-webmvc. The main sources only touchjackson-annotations, so they compiled; every test that reads a response as aJsonNodedid not.org.springframework.boot.test.autoconfigure.web.servletno longer exists under that name, so@AutoConfigureMockMvcandMockMvccould not resolve.The fix
jackson-databindadded as a test dependency, version managed by the Boot BOM.OrderApiTestrewritten:@SpringBootTest(webEnvironment = RANDOM_PORT)starts the real application on a random port and the JDK HTTP client drives it. Same six behaviours asserted, no dependency on any test-autoconfiguration package — and it now matches how the Go, Python and C# starters test.Also kept
The CI step that echoes Maven errors and the surefire reports as annotations. It does nothing on a green build and saves downloading a log on a red one.
Generated by Claude Code