pact-foundation / pact-jvm

JVM version of Pact. Enables consumer driven contract testing, providing a mock service and DSL for the consumer project, and interaction playback and verification for the service provider project.
https://docs.pact.io
Apache License 2.0
1.08k stars 479 forks source link

Unstable key generation with multiple provider states #1717

Closed rkrishnan2012 closed 12 months ago

rkrishnan2012 commented 1 year ago

Hello,

I am using the Pact JVM + Pact protobuf plugin to generate a consumer contract, but upon re-running the same consumer test twice, there are two interactions created (same contents, just different key). I narrowed it down to only happening when I have a single provider state with multiple parameters passed in, like so:

"providerStates": [
        {
          "name": "a user profile exists",
          "params": {
            "email_address": "test@email.com",
            "family_name": "Test",
          }
        }
],

Is this a bug in the pact JVM or in the protobuf plugin? It seems eerily similar to this bug but seems like that's closed.

rholshausen commented 1 year ago

That fix should be in the latest version of the protobuf plugin, check that you have updated it. I'll check Pact-JVM to see if there is an issue there.

rkrishnan2012 commented 12 months ago

Closing this for now until we can repro this locally. Thanks!