Bugfix: Fix list reference behavior in RequestPatternBuilder.like()#2897
Bugfix: Fix list reference behavior in RequestPatternBuilder.like()#2897narcoticfresh wants to merge 2 commits intowiremock:masterfrom
Conversation
…eferences to the other objects' lists
|
Many thanks for this PR. At the moment this is a breaking change for all the people who might be relying on the existing functionality. Is there any way to do this without it being a breaking change? |
|
@leeturner i think one may decide (i'm not sure how those decisions are formed within the wiremock project) which one should be the "correct" behavior of if it shall be changed (and thus only then it will be behaving like widely used form of the if that is not desired, another approach could be to just introduce for example let me know if i should add this to the pr.. |
|
At the moment I think the |
|
Could we make the name explicitly indicate that the body patterns would be merged rather than replaced? Or add an overload of |
References
I recently was very confused when I did this:
What happens is, is that now both
RequestPatterninstances contain the sameContentPatterninstances.Now, I think this is counter intuitive - I would expect that any changes
requestPatternBare not reflecting back torequestPatternAafter usinglike(). Would you share that assumption?This pull request changes the current behavior by making sure that new lists are created in
like(), thus not referencing the lists inrequestPatternAanymore.Submitter checklist
#help-contributingor a project-specific channel like#wiremock-java