pact-foundation / pact-jvm

JVM version of Pact. Enables consumer driven contract testing, providing a mock service and DSL for the consumer project, and interaction playback and verification for the service provider project.
https://docs.pact.io
Apache License 2.0
1.08k stars 479 forks source link

How to set up WireMock pact generator for JUnit 5 #1535

Open tl-madhulika-mitra opened 2 years ago

tl-madhulika-mitra commented 2 years ago

Hi Team - I am unable to add issues here , so asking the question/issue here.

For Pact to listen to wire mock we are supposed to use the below, but we are using wireMockRuntimeInfo in our project. How could we make pact listen to it and generate the contract wireMockServer.addMockServiceRequestListener( WireMockPactGenerator .builder("consumer", "producer") .build());

YOU54F commented 2 years ago

Hey,

Check out this repo for examples (albeit looking at the docs, they don't mention Junit support, just states maven and gradle)

https://github.com/pactflow/example-bi-directional-consumer-wiremock/blob/631dc7026ef3986fe60833b8006b823d6287317d/src/test/java/com/example/products/ProductApiClientTest.java#L37

You would probably be best asking this question in our slack group http://slack.pact.io/ as this question doesn't relate to pact-jvm.

I appreciate that the atlassian repository doesn't accept issues (it is not the same across the board, so they may wish to open that up in the future), however you will find many of the Atlassian team are actually members of our Slack community

gurubabujampala commented 1 year ago

Hope this should be helpful for you https://github.com/Arsenalist/pact-junit5-wiremock-spring-example