How can a plugin author lookup an Interaction in the Pact struct during PrepareInteractionForVerification
?
#35
Labels
enhancement
Indicates new feature requests
smartbear-supported
SmartBear engineering team will support this issue. See https://docs.pact.io/help/smartbear
This request was spawned from pact-foundation/pact-reference#278
Background
I'm trying to understand how a Plugin can look up the interaction in the pact file during verification.
In
PrepareInteractionForVerification
andVerifyInteraction
the plugin will receive anInteractionKey
that has a unique reference for the plugin to (presumably) label and find an interaction.In the case of
PrepareInteractionForVerification
if no key is set on the interaction in the consumer DSL, thePact
struct if parsed, will not have any interactions with a key on them, and thus the interaction can't be found this way. There is no other identifying information at this step that can be used to look up the correct interaction from the pact.This is why had the previous query about the keys above. I'm confused as to how the gRPC plugin is able to lookup by the interaction's key, despite not setting keys explicitly from the client. The
Pact
struct serialised over the protobuf definition does not have any keys in it:For example, here is a Golang log message for the incoming message for
VerifyInteraction
:Note how the
interactionKey
is present on the struct, but there is no matching key in the Pact struct.This leads me to think that
unique_key
is an internal method only available to the Rust library, and not something that can be relied upon over the wire, and is why I thought removing the key generation could be a breaking change as far as behaviour is concerned.(UPDATE: I thought perhaps I could work around it by setting a key on the interaction but I don't think there is an FFI for it)
Response from Ron:
Ask
How can a plugin author lookup an Interaction in the Pact struct during
PrepareInteractionForVerification
?The text was updated successfully, but these errors were encountered: