https://pact.io logo
#pact-jvm
Title
# pact-jvm
m

Mike

03/15/2022, 12:12 PM
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

Matt (pactflow.io / pact-js / pact-go)

03/15/2022, 1:42 PM
Check the annotation, I think there is another with the same name which is the correct one
m

Mike

03/15/2022, 1:46 PM
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

uglyog

03/15/2022, 10:10 PM
Try making your test class public
👍 1
m

Mike

03/16/2022, 7:26 AM
It's kotlin. With public modifier behaviour is the same
g

gesellix

03/16/2022, 12:43 PM
where is the
pact-files
folder located? Maybe the base path is different?
m

Mike

03/16/2022, 12:57 PM
pact-files is in the root folder of the project. And path works for Consumer tests, which generates this pact file
g

gesellix

03/17/2022, 9:20 PM
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

uglyog

03/17/2022, 10:13 PM
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.
8 Views