Skip to content

docs: add RestTestClient integration testing example - #2782

Merged
rjayasinghe merged 2 commits into
mainfrom
rest_test_client
Jul 30, 2026
Merged

docs: add RestTestClient integration testing example#2782
rjayasinghe merged 2 commits into
mainfrom
rest_test_client

Conversation

@rjayasinghe

Copy link
Copy Markdown
Contributor

What

Adds a RestTestClient example alongside the existing MockMvc example in the Java integration testing guide (java/developing-applications/testing.md).

Why

Spring Framework 7.0 introduced RestTestClient. This documents it as an equivalent alternative for CAP Java integration tests.

Details

  • Splits the Integration Testing section into Using MockMvc (unchanged) and Using RestTestClient.
  • The RestTestClient code is copied from the CAP Java bookshop sample (uses @AutoConfigureRestTestClient + @Autowired RestTestClient and the typed .value(String.class, ...) assertion).
  • States both approaches are equivalent with no preference.
  • Links the Spring MockMvc and RestTestClient reference docs.

Add a RestTestClient variant alongside the existing MockMvc example in
the Java integration testing guide. The RestTestClient code is taken
from the CAP Java bookshop sample. Note that both approaches are
equivalent with no preference, and link the Spring MockMvc and
RestTestClient reference docs.
@rjayasinghe
rjayasinghe requested a review from agoerler July 29, 2026 14:08

@agoerler agoerler left a comment

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.

perfect

@rjayasinghe
rjayasinghe added this pull request to the merge queue Jul 30, 2026
Merged via the queue into main with commit 33ae62d Jul 30, 2026
4 checks passed
@rjayasinghe
rjayasinghe deleted the rest_test_client branch July 30, 2026 06:57
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.

2 participants