Do you have recommendation when a code base is bot...
# general
é
Do you have recommendation when a code base is both consumer and provider? Do you create 2 distinguished tasks? How do you identify provider/consumer test to run? One of our team created 2 task:
testContractConsumer
and
testContractProvider
then used tag annotation
Copy code
# build.gradle.kts
useJUnitPlatform {    
      includeTags("consumer")    
}
And in the test file
@Tag("provider")
or
@Tag("consumer")
t
Yes, I think two different tasks is the way to go
1
As you need to publish the pact before you start the verification
(well, you don’t need to, since you could point at the local pact that you had just generated, too- but I think it’s the least fiddly to have all the tasks that you would if they were separate services)
I have a service which is its own consumer, and for that I treat it as if it had the “consumer tests” and the “provider tests”, just as it would if they were separate. This way, if I add other consumers, or pull one of them out to a separate service, then it’s safe