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

Groovy DSL method invocation order affects behaviour #1287

Open
topr opened this issue Jan 13, 2021 · 2 comments
Open

Groovy DSL method invocation order affects behaviour #1287

topr opened this issue Jan 13, 2021 · 2 comments

Comments

@topr
Copy link

topr commented Jan 13, 2021

After upgrading from 3.x to 4.1.x I've noticed consumer side no longer publishes providerStates on some Pacts we have.
It took quite a while to narrow the thing down. In Short:

new PactBuilder().with {
    given 'foo'
    uponReceiving 'bar'
    // ...
}

...works as expected whilst:

new PactBuilder().with {
    uponReceiving 'bar'
    given 'foo'
    // ...
}

...does not publish the state.

Is it by design?

Although it makes more sense to declare a state first and then an action, order of DSL method invocations shouldn't really matter, should it?

Thanks!

@uglyog
Copy link
Member

uglyog commented Jan 31, 2021

That's not by design, it is probably a regression.

@topr
Copy link
Author

topr commented Feb 1, 2021

Thanks for the confirmation. That was a tricky one to nail, I've learnt a lot about the Pacts mechanics while doing so though 😉

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

3 participants