RestTestClient.mutate() should not have side effects#35698
Closed
UpStreamThomas wants to merge 2 commits intospring-projects:mainfrom
Closed
RestTestClient.mutate() should not have side effects#35698UpStreamThomas wants to merge 2 commits intospring-projects:mainfrom
UpStreamThomas wants to merge 2 commits intospring-projects:mainfrom
Conversation
7916536 to
3df1c62
Compare
3df1c62 to
5b30f1d
Compare
Contributor
|
Thanks for the pull request .This is done in |
Author
I did not notice that that builder was cloned in the |
Contributor
|
Yes, it should be removed from |
Before this change, DefaultRestTestClient.mutate() was reusing the underlying builder all calls. Building a new builder for each call clones the RestTestClientBuilder, protecting from side effects. Signed-off-by: Thomas Recloux <trecloux@purse.eu>
Signed-off-by: Thomas Recloux <trecloux@purse.eu>
5b30f1d to
c72052c
Compare
Author
I added a commit with clone removed from |
rstoyanchev
pushed a commit
that referenced
this pull request
Nov 3, 2025
See gh-35698 Signed-off-by: Thomas Recloux <trecloux@purse.eu>
Contributor
|
On closer look, we need to keep the cloning in build() to protect against changes to the original builder. I've added an additional test for that. |
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.
Before this change,
DefaultRestTestClient.mutate()was reusing the underlying builder all calls.Building a new builder for each call clones the
RestTestClientBuilder, protecting from side effects.