I have two projects in the same repo, with completely separate directory structures (consumer in /test-consumer
, provider in /app
).
The consumer check outputs a JSON Pact file in /test-consumer/build/pacts
, as expected by
dependencies { test { systemProperties['pact.rootDir'] = "$buildDir/pacts" } }
I then copy the file into /app/build/pacts/
, and put this same systemProperties
line into my provider's build.gradle
.
The sample project that I'm plagiarising from is using a Pact broker, so I guessed I can take that out, and replace it with the rootDir
, but it's not working. This is what I get:
WARNING: There are no consumers to verify for provider 'Coffee Ordering Provider'
So, it seems like it's finding the Pact files, but can't find a provider+consumer pair in any of them.
TL;DR: What am I doing wrong?
Here are some code bits to help:
dependencies {
...
test { systemProperties['pact.rootDir'] = "$buildDir/pacts" }
}
pact {
serviceProviders {
'Coffee Ordering Provider' {
port = 8080
startProviderTask = startProvider
terminateProviderTask = stopProvider
stateChangeUrl = url('http://localhost:8080/pactStateChange')
}
}
}