gradle pactVerify failed (Task with path testClasses not found)
build.gradle
plugins {
id "au.com.dius.pact" version "3.2.11"
}
pact {
serviceProviders {
providerSales {
protocol = 'http'
host = 'localhost'
port = 5006
path = '/lookupservice'
hasPactsWith('manyConsumers') {
pactFileLocation = file('pacts')
}
}
}
}
One pact file is saved under ./pacts/
PS C:\Users\avinogradov> gradle pactVerify
FAILURE: Build failed with an exception.
* What went wrong:
Could not determine the dependencies of task ':pactVerify_providerSales'.
> Task with path 'testClasses' not found in root project 'avinogradov'.
What test classes? I though verification can be run against running provider with just pact file, can't it?
You are correct, except for verifying messages the test class path is used. I'll put a change in to only add the testClasses if it exists in the project.
In the mean time, just add the java plugin to your build.gradle.
Hi @uglyog , I met an issue recently.I added the spring dev tools plugin into my project. And when I run pactVerify task it will run the testClasses task. after testClassed finished, it will trigger the dev tools to restart the application which caused the pactVerify fail.
@pei-wang could you include the error and stack trace?