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

OR matcher no longer accepts null example value #1281

Closed
topr opened this issue Dec 30, 2020 · 1 comment
Closed

OR matcher no longer accepts null example value #1281

topr opened this issue Dec 30, 2020 · 1 comment

Comments

@topr
Copy link

topr commented Dec 30, 2020

On the 3.x Pacts DSL version I used to have a contract defined like

{
    errorCode or(failureCode, nonEmptyString(), nullValue())
}

...where the failureCode variable was either populated or null depending on the test case variant executed.
The nonEmptyString() is my custom method based returning configured regex matcher (irrelevant to the issue).

I've just updated to the 4.1.x Pact libs and the or() matcher throws IllegalArgumentException when the example value is null.

What is the way now to declare a contract which says: expect some value of certain format or null?

@topr
Copy link
Author

topr commented Jan 14, 2021

I've used version 4.1.14 and the issue is gone. Thanks!

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

No branches or pull requests

1 participant