Skip to content

Sequence of "description" and "providerStates" in messaging provider verification. #542

@dranidis

Description

@dranidis

Version information:

  • OS: Arch Linux
  • PactNet Version: 5.0.1
  • .Net Version: 8.0.100
  • Pact Broker Version (if applicable): NA

Describe the bug
Description handler is executed before the state handler.

Steps To Reproduce
The current behaviour can be reproduced with the code in this repo: https://github.com/dranidis/pact-dotnet-message-provider

Expected behavior
We have a provider test of an AMQP interaction in Pact. The interaction has a "description" and "providerStates". We added in the test:

.WithMessages(scenarios =>  {
                    scenarios.Add(
                        "scenario description",
                        builder => SetupDescriptionA(builder));
                }, _serializerOptions) ...

and the state handler "prepare data" in the middleware.
I would expect the state handler to execute FIRST to prepare the data for the content of the message, and THEN the description handler to execute SECOND so that it uses a messageProducer function to generate the message based on the prepared data, But it is the opposite!
This forces us to abandon providerStates and only use descriptions for both setting the environment and producing the message.
In case, I misunderstand something please let me know.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIndicates an unexpected problem or unintended behaviortriageThis issue is yet to be triaged by a maintainer

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions