Skip to content
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

WithoutHeader fluent assertion #1048

Closed
jvmlet opened this issue Dec 25, 2023 · 6 comments
Closed

WithoutHeader fluent assertion #1048

jvmlet opened this issue Dec 25, 2023 · 6 comments
Assignees
Labels

Comments

@jvmlet
Copy link

jvmlet commented Dec 25, 2023

Please support WithoutHeader in WireMockAssertions
Thanks

@jvmlet jvmlet added the feature label Dec 25, 2023
@StefH StefH self-assigned this Dec 25, 2023
@StefH
Copy link
Collaborator

StefH commented Dec 25, 2023

#1049

@StefH
Copy link
Collaborator

StefH commented Dec 25, 2023

@jvmlet
Can you check the PR if this is what you need?

@StefH
Copy link
Collaborator

StefH commented Dec 26, 2023

If you want, you can try preview version 1.5.46-ci-18207

@jvmlet
Copy link
Author

jvmlet commented Dec 26, 2023

Can you check the PR if this is what you need?

Thanks @StefH , would you please add WithoutHeader(string name), regardless the value ?

We integrated HeadersPropagation extension from MS and I want to make sure some headers don't leak to downstream services, no matter what the value is.

[CustomAssertion]
    public AndConstraint<WireMockAssertions> WithoutHeader(string expectedKey,  string because = "", params object[] becauseArgs)
        => WithoutHeader(expectedKey, Array.Empty<string>(), because, becauseArgs);

@StefH
Copy link
Collaborator

StefH commented Dec 26, 2023

The problem is that I cannot keep that proposed method definition.
That because and becauseArgs will make the other existing WithoutHeader methods invalid.

So I can do:

public AndConstraint<WireMockAssertions> WithoutHeader(string unexpectedKey, (string Text, object[] Args)? because = null)

or / and

public AndConstraint<WireMockAssertions> WithoutHeaderKey(string unexpectedKey, string because = "", params object[] becauseArgs)

@jvmlet
Copy link
Author

jvmlet commented Dec 26, 2023

WithoutHeaderKey looks great, thanks a lot.

@StefH StefH closed this as completed Dec 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants