I have a scenario where my provider service provides 3 functionalities. At consumer end I have 3 different classes to write tests for these 3 functionalities. When pact file is generated, it encompasses all the tests with same consumer-provider combination. so far so good.
When it comes to provider tests, I wish to have a same structure of 3 classes for 3 functionalities. But if I do that and when I run tests from 1st class, PACT also tries to search for other methods as per the pact file and fails cos of other methods not found. How can I handle this scenario.
example:
ConsumerTestClass1
ConsumerTestClass2
ConsumerTestClass3
all define the below pact
@Pact(provider = PROVIDER, consumer = CONSUMER)
public MessagePact createPactForCareerLevelClassifier(MessagePactBuilder builder) {}
Now lets say every class has 3 test methods, so pact file in all will have 9
On provider side I have 3 test classes
ProvdiderTestClass1
ProvdiderTestClass2
ProvdiderTestClass3
ProviderTestClass1 has actual test annotated with @PactVerifyProvider
Now when I run tests for ProviderTestClass1 , PACT complains that it was not able to find any methods matching for 6 other contracts which are actually in ProvdiderTestClass2 and ProvdiderTestClass3 classes