pact-jvm icon indicating copy to clipboard operation
pact-jvm copied to clipboard

Overriding verifyResponseFromProvider Method in Pact Framework Using Java

Open rizwanansari367 opened this issue 9 months ago • 2 comments

I'm currently using the following dependencies in my Java project:

'au.com.dius.pact:consumer:4.1.41',
'au.com.dius.pact.consumer:junit:4.1.41',
'au.com.dius.pact.provider:junit:4.1.41',

I would like to override the verifyResponseFromProvider method in the Pact framework, The purpose of the overriding this method is to modify the actual response before actual verification takes place. In my project there are some APIs, every time return different response, so i want to assert partial response.

fun verifyResponseFromProvider(
provider: IProviderInfo,
interaction: RequestResponseInteraction,
interactionMessage: String,
failures: MutableMap<String, Any>,
client: ProviderClient,
context: Map<String, Any>,
pending: Boolean
): VerificationResult

Can you please provide guidance on how to achieve this in Java? Additionally, if there are any best practices or recommended approaches for extending the Pact framework, please let me know.

rizwanansari367 avatar Sep 22 '23 11:09 rizwanansari367