Pact.Builders.InteractionBuilder (pact_consumer_ex v0.2.1)
Builder for Interaction
objects. Normally created via
Pact.Builder.PactBuilder.interaction
.
Summary
Functions
The interaction we've built.
The interaction we've built (in V4 format).
Adds a text comment to this interaction. This allows to specify just a bit more information about the interaction. It has no functional impact, but can be displayed in the broker HTML page, and potentially in the test output.
Specify a "provider state" for this interaction. This is normally use to set up database fixtures when using a pact to test a provider.
Specify a "provider state" for this interaction with some defined parameters. This is normally use to set up database fixtures when using a pact to test a provider.
Create a new interaction.
Sets this interaction as pending. This will permantly mark the interaction as pending in the Pact file, and it will not cause a verification failure.
Define the request for this interaction.
Define the response for this interaction.
Sets the test name for this interaction. This allows to specify just a bit more information about the interaction. It has no functional impact, but can be displayed in the broker HTML page, and potentially in the test output.
Sets the protocol transport for this interaction. This would be required when there are different types of interactions in the Pact file (i.e. HTTP and messages).
Specify a unique key for this interaction. This key will be used to determin equality of the interaction, so must be unique.
Functions
@spec build(builder :: Pact.Native.PactConsumer.InteractionBuilder.t()) :: Pact.Native.PactConsumer.Interaction.t()
The interaction we've built.
@spec build_v4(builder :: Pact.Native.PactConsumer.InteractionBuilder.t()) :: Pact.Native.PactConsumer.Interaction.t()
The interaction we've built (in V4 format).
@spec comment( builder :: Pact.Native.PactConsumer.InteractionBuilder.t(), comment :: String.t() ) :: Pact.Native.PactConsumer.InteractionBuilder.t()
Adds a text comment to this interaction. This allows to specify just a bit more information about the interaction. It has no functional impact, but can be displayed in the broker HTML page, and potentially in the test output.
@spec given( builder :: Pact.Native.PactConsumer.InteractionBuilder.t(), given :: String.t() ) :: Pact.Native.PactConsumer.InteractionBuilder.t()
Specify a "provider state" for this interaction. This is normally use to set up database fixtures when using a pact to test a provider.
@spec given_with_params( builder :: Pact.Native.PactConsumer.InteractionBuilder.t(), given :: String.t(), params :: term() ) :: Pact.Native.PactConsumer.InteractionBuilder.t()
Specify a "provider state" for this interaction with some defined parameters. This is normally use to set up database fixtures when using a pact to test a provider.
@spec new(description :: String.t(), interaction_type :: String.t()) :: Pact.Native.PactConsumer.InteractionBuilder.t()
Create a new interaction.
@spec pending( builder :: Pact.Native.PactConsumer.InteractionBuilder.t(), pending :: bool() ) :: Pact.Native.PactConsumer.InteractionBuilder.t()
Sets this interaction as pending. This will permantly mark the interaction as pending in the Pact file, and it will not cause a verification failure.
@spec request( builder :: Pact.Native.PactConsumer.InteractionBuilder.t(), build_fn :: (request_builder :: Pact.Native.PactConsumer.RequestBuilder.t() -> Pact.Native.PactConsumer.RequestBuilder.t()) ) :: Pact.Native.PactConsumer.InteractionBuilder.t()
Define the request for this interaction.
@spec response( builder :: Pact.Native.PactConsumer.InteractionBuilder.t(), build_fn :: (response_builder :: Pact.Native.PactConsumer.RequestBuilder.t() -> Pact.Native.PactConsumer.RequestBuilder.t()) ) :: Pact.Native.PactConsumer.InteractionBuilder.t()
Define the response for this interaction.
@spec test_name( builder :: Pact.Native.PactConsumer.InteractionBuilder.t(), name :: String.t() ) :: Pact.Native.PactConsumer.InteractionBuilder.t()
Sets the test name for this interaction. This allows to specify just a bit more information about the interaction. It has no functional impact, but can be displayed in the broker HTML page, and potentially in the test output.
@spec transport( builder :: Pact.Native.PactConsumer.InteractionBuilder.t(), name :: String.t() ) :: Pact.Native.PactConsumer.InteractionBuilder.t()
Sets the protocol transport for this interaction. This would be required when there are different types of interactions in the Pact file (i.e. HTTP and messages).
@spec with_key( builder :: Pact.Native.PactConsumer.InteractionBuilder.t(), key :: String.t() ) :: Pact.Native.PactConsumer.InteractionBuilder.t()
Specify a unique key for this interaction. This key will be used to determin equality of the interaction, so must be unique.