-
-
Notifications
You must be signed in to change notification settings - Fork 214
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WithCallback circumvent the rest of the builder #569
Comments
@rlf I understand your issue. I cannot remember anymore why I decided that WithCallback does behave like this. However, I see that in that case the fluentbuilder should not return a chainable thing so that it seems that you can add more fluent methods. I'll check if it's easy to change that all additional .WIth*** are used. |
Hello @rlf, Can you please try preview NuGet |
Dear @rlf ; did you have time to test this? |
Verified. At least the tests I wrote when discovering this bug is now green. |
@rlf Thank you for testing. I'll release a new official version today. |
Describe the bug
The code-line listed here:
WireMock.Net/src/WireMock.Net/ResponseBuilders/Response.cs
Line 374 in ebb9f12
Effectively disables part of the builder - which IMO ruins the builder-pattern for the response builder.
Expected behavior:
I would expect the following code:
to generate a responsemessage with what-ever the callback provides, but with the status-code
Created
and the additional headerX-UserId
.Test to reproduce
Create any
Given().RespondWith()
chain that mixes bothWithCallback
and other builder-inputs.Verify the Callback short-circuits anything else you put into the Builder-pattern.
I do get, how-ever, that if the callback changes the default value of say the Status - that status should prevail - but not if you specifically add a non-default status to your response, using the builder.
Other related info
None that I can think of.
The text was updated successfully, but these errors were encountered: