Hi, 4.1.34 trying to execute provider tests ```@P...
# pact-jvm
m
Hi, 4.1.34 trying to execute provider tests
Copy code
@PactDirectory("pact-files")
@Provider("iPaaS_Stripe")
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
class PactStripeProviderTest {
as a result
Copy code
Did not find any PactSource annotations. At least one pact source must be set
java.lang.UnsupportedOperationException: Did not find any PactSource annotations. At least one pact source must be set
However, pact is present in pact-files folder. Do you know how to handle this?
m
Check the annotation, I think there is another with the same name which is the correct one
m
I tried PactFolder - result is the same. Moreover PactFolder is marked as deprecated
Seems it works if I choose PactBroker, but I need to use PACT file from folder
I use this doc
u
Try making your test class public
👍 1
m
It's kotlin. With public modifier behaviour is the same
g
where is the
pact-files
folder located? Maybe the base path is different?
m
pact-files is in the root folder of the project. And path works for Consumer tests, which generates this pact file
g
I would expect that the
pact-files
folder would be found at the root of the classpath. So, in a Maven or Gradle project you should try to put the
pact-folder
at
<project-root>/src/test/resources/pact-folder/
.
u
the
@PactDirectory
annotation is used to set the output directory that the consumer tests write pacts to.
<http://au.com|au.com>.dius.pact.provider.junitsupport.loader.@PactFolder
is used to setup a loader to load Pacts from a directory.