Skip to content

Request/Response and messaging in same service; how do we filter? #539

Open
@robbiewareham

Description

@robbiewareham

I am using PactNet 5.0.1 and I have a service that provides the following:

  • POST request is made to my service which results in a message being written to a 3rd party queue.

I now have two pact files hosted in PactBroker; one generated by the consumer of the POST endpoint, the other generated by the process that reads the messages from the queue.

I've implemented the verification by having 2 classes, each with one Xunit test.

One class uses MessagingProvider and is configured to download from a pact broker:

 using var verifier = new PactVerifier(config);
   
 verifier.MessagingProvider("personal-details-api", CreateJsonSettings())
         .WithProviderMessages(scenarios =>
         {
             scenarios.Add("An event is created", _event);
         })
         .WithPactBrokerSource(_pactBrokerUri)
         .Verify();
 }

I was hoping/assuming that this would only download the messaging pact from pact broker but it is also downloading the request/response pact too so fails as it only expects messages.

The "provider" name in Pact Broker is the same (which makes sense to me as the provider is the same), but do I have to have unique provider names?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions