-
Notifications
You must be signed in to change notification settings - Fork 233
Description
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.