Hello! In this example <https://docs.pact.io/imple...
# pact-jvm
e
Hello! In this example https://docs.pact.io/implementation_guides/jvm/provider#an-example-of-running-provider-verification-with-junit we have this comment "// setup any provider state", how can I setup the provider state?? Thank you!
m
Are you using junit4 or 5?
That isn’t supposed to be a full example, from what I can see
see also the JVM workshop 👇 (howtolearn)
s
Here are a number of useful hands-on labs that teach all of the key concepts: https://docs.pactflow.io/docs/workshops and https://docs.pact.io/implementation_guides/workshops
e
Thank you for the answer, in fact I'm working with groovy and Spock. Finally I have this working with this example https://docs.pact.io/implementation_guides/jvm/provider#an-example-of-running-provider-verification-with-spock
👍 1
The only think, is that it could be great if as we have this "consumer.stateChange" to initialize data, have another point to verify the data created, after the execution of the POST
Because I have, lets say 5 states, that generate 5 types of documents, it will be great to verify the 5 types of docs that are saved in a DB.
m
I’m not sure what you’re asking sorry. But Pact can definitely test as many scenarios as you want. Each of thos eshould be a different test
If the shape of the data is the same, but just different values, you might want to consider testing that in other ways
e
Yes, I know that the business should be tested in other type of tests, but in this case would be nice to verify "Does the provider do the right thing with the request?" within the same contract.
In provider test
m
Maybe if you could provide more detail on what you’re trying to do I could help? We’re talking abstracts here, if you could please describe the scenario in more detail and perhaps some code samples to illustrate, I could give more specific help
e
The arrow is where all the interactions are exceuted, once executed it returns the control. Can I do any verification of the system after the execution of every interaction?