0

I'm new to pact. My project is Java project. I read through pact documentation and found the github project https://github.com/DiUS/pact-jvm/tree/master/pact-jvm-consumer-junit I imported it in my eclipse IDE. I'm stuck from here. 1. Which test to run first. ExampleJavaConsumerPactRuleTest or ExampleJavaConsumerPactTest? 2. I see that it is a gradle build. How to configure the run configurations. What are the arguments and commands to provide?

sandstone
  • 1
  • 2
  • 2
    What have you tried? Seems like you've imported it and ignored the readme. You do not have to build it yourself, as per the readme, it's already built and readily available on maven central: group-id = au.com.dius artifact-id = pact-jvm-consumer-junit_2.11 version-id = 3.0.x – J_A_X Jan 30 '17 at 05:58

2 Answers2

2

The PACT starts with the consumers that say what they expect from the provider. Then, later, the provider needs to be checked if it fits into the pacts defined by every consumer.

So, the first thing to do it is to create the consumer that act like the provider exists, defining what it is expected from that provider.

I just created one consumer example, https://github.com/thiagomata/helloword-pact-consume that is ready to go. As I said before, you can run that consumer and define the pact without the existence of the provider.

The library that I am using runs and update the pact with the JUnit tests. I hope that helps.

Thiago Mata
  • 2,825
  • 33
  • 32
1

The question here is how do you want to go about it. Its Consumer driven. So you should first make the Consumer test so that you have a pact file so you can use that in your provider test.

A good start is reading this on the pact website: https://docs.pact.io Hope this helps

Mahesh
  • 1,427
  • 2
  • 19
  • 42
Thadir
  • 201
  • 2
  • 16