Pact.Builders.PactBuilder (pact_consumer_ex v0.2.0)
Builder for Pact
objects.
Summary
Functions
Add a new HTTP Interaction
to the Pact
. Needs to return a clone of the builder that is passed in.
Add a new Asynchronous message Interaction
to the Pact
Returns an iterator over the asynchronous messages in the Pact
Create a new PactBuilder
, specifying the names of the service
consuming the API and the service providing it.
Create a new PactBuilder
for a V4 specification Pact, specifying the names of the service consuming the API and the service providing it.
Start a mock server running in a background thread. If the catalog entry is omitted, then a standard HTTP mock server will be started.
Checks whether the given pact builder is using the V4 specification.
Functions
@spec interaction( builder :: Pact.Native.PactConsumer.PactBuilder.t(), description :: String.t(), interaction_type :: String.t(), build_fn :: (interaction_builder :: Pact.Native.PactConsumer.InteractionBuilder.t() -> Pact.Native.PactConsumer.InteractionBuilder.t()) ) :: Pact.Native.PactConsumer.PactBuilder.t()
Add a new HTTP Interaction
to the Pact
. Needs to return a clone of the builder that is passed in.
@spec message_interaction( builder :: Pact.Native.PactConsumer.PactBuilder.t(), description :: String.t(), build_fn :: (message_interaction_builder :: Pact.Native.PactConsumer.MessageInteractionBuilder.t() -> Pact.Native.PactConsumer.MessageInteractionBuilder.t()) ) :: Pact.Native.PactConsumer.PactBuilder.t()
Add a new Asynchronous message Interaction
to the Pact
@spec messages(builder :: Pact.Native.PactConsumer.PactBuilder.t()) :: [ Pact.Native.PactConsumer.AsynchronousMessage.t() ]
Returns an iterator over the asynchronous messages in the Pact
@spec new(consumer :: String.t(), provider :: String.t()) :: Pact.Native.PactConsumer.PactBuilder.t()
Create a new PactBuilder
, specifying the names of the service
consuming the API and the service providing it.
@spec new_v4(consumer :: String.t(), provider :: String.t()) :: Pact.Native.PactConsumer.PactBuilder.t()
Create a new PactBuilder
for a V4 specification Pact, specifying the names of the service consuming the API and the service providing it.
@spec start_mock_server(builder :: Pact.Native.PactConsumer.PactBuilder.t()) :: :ignore | {:error, any()} | {:ok, pid()}
Start a mock server running in a background thread. If the catalog entry is omitted, then a standard HTTP mock server will be started.
@spec v4?(builder :: Pact.Native.PactConsumer.PactBuilder.t()) :: bool()
Checks whether the given pact builder is using the V4 specification.