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

Added support of custom matchers in static mappings #713

Merged

Conversation

levanoz
Copy link
Contributor

@levanoz levanoz commented Jan 12, 2022

No description provided.

@levanoz levanoz requested a review from StefH January 12, 2022 18:11
Copy link
Collaborator

@StefH StefH left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for this PR.

@levanoz levanoz requested a review from StefH January 12, 2022 18:38
@StefH
Copy link
Collaborator

StefH commented Jan 13, 2022

@levanoz
Thanks a lot.

Did you test this code change in a real environment?

@levanoz
Copy link
Contributor Author

levanoz commented Jan 13, 2022

@levanoz Thanks a lot.

Did you test this code change in a real environment?

@StefH
My bad, I forgot to run it :(
I just wrote unit tests for MatcherModelMapper and thought that would be enaugh.
Now I've run it, there was JSON serialization issue, which I've fixed by adding JsonIgnore attribute to CustomMatcherMappings property in settings. Is it okay?
Thanks a lot for reviews.

@StefH
Copy link
Collaborator

StefH commented Jan 13, 2022

@levanoz
I think it's correct for now.

I was thinking...

Maybe can you also add a 'real' test like this one:

public async Task WireMockServer_WithBodyAsJson_Using_PostAsync_And_WildcardMatcher_ShouldMatch()

But intead using the wildcardMatcher, use your own test-custom matcher.

@levanoz
Copy link
Contributor Author

levanoz commented Jan 13, 2022

@levanoz I think it's correct for now.

I was thinking...

Maybe can you also add a 'real' test like this one:

public async Task WireMockServer_WithBodyAsJson_Using_PostAsync_And_WildcardMatcher_ShouldMatch()

But intead using the wildcardMatcher, use your own test-custom matcher.

@StefH
I've added two 'real' tests:

public async Task WireMockServer_Using_JsonMapping_And_CustomMatcher_WithCorrectParams_ShouldMatch()

public async Task WireMockServer_Using_JsonMapping_And_CustomMatcher_WithIncorrectParams_ShouldNotMatch()

@levanoz
Copy link
Contributor Author

levanoz commented Jan 17, 2022

Hi @StefH ,
Thank you for review and approval.
When do you plan to merge this branch and release new package with these changes?

@StefH
Copy link
Collaborator

StefH commented Jan 17, 2022

Later today I'll merge and release a new version.

@levanoz
Copy link
Contributor Author

levanoz commented Jan 17, 2022

@StefH
Sounds great, thank you!

@StefH StefH merged commit 6b393eb into WireMock-Net:master Jan 17, 2022
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.

None yet

2 participants