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

interaction(builder, description, interaction_type, build_fn)

@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.

message_interaction(builder, description, build_fn)

Add a new Asynchronous message Interaction to the Pact

messages(builder)

Returns an iterator over the asynchronous messages in the Pact

new(consumer, provider)

@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.

new_v4(consumer, provider)

@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.

start_mock_server(builder)

@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.

v4?(builder)

@spec v4?(builder :: Pact.Native.PactConsumer.PactBuilder.t()) :: bool()

Checks whether the given pact builder is using the V4 specification.