Pact.Builders.MessageBuilder (pact_consumer_ex v0.2.0)
Asynchronous message interaction builder. Normally created via Pact.Builders.PactBuilder.message_interaction
.
Summary
Functions
The interaction we've built
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.
Specify the body as JsonPattern
, possibly including special matching
rules.
Create a new message interaction builder, Description is the interaction description and interaction_type is the type of message (leave empty for the default type).
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.
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.
Specify a unique key for this interaction. This key will be used to determine equality of the interaction, so must be unique.
Functions
@spec build(builder :: Pact.Native.PactConsumer.MessageInteractionBuilder.t()) :: Pact.Native.PactConsumer.Interaction.t()
The interaction we've built
@spec comment( builder :: Pact.Native.PactConsumer.MessageInteractionBuilder.t(), comment :: String.t() ) :: Pact.Native.PactConsumer.MessageInteractionBuilder.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.MessageInteractionBuilder.t(), given :: String.t() ) :: Pact.Native.PactConsumer.MessageInteractionBuilder.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.MessageInteractionBuilder.t(), given :: String.t(), params :: term() ) :: Pact.Native.PactConsumer.MessageInteractionBuilder.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 json_body( builder :: Pact.Native.PactConsumer.MessageInteractionBuilder.t(), body :: Pact.Patterns.json_pattern() ) :: Pact.Native.PactConsumer.MessageInteractionBuilder.t()
Specify the body as JsonPattern
, possibly including special matching
rules.
@spec new(description :: String.t()) :: Pact.Native.PactConsumer.MessageInteractionBuilder.t()
Create a new message interaction builder, Description is the interaction description and interaction_type is the type of message (leave empty for the default type).
@spec pending( builder :: Pact.Native.PactConsumer.MessageInteractionBuilder.t(), pending :: bool() ) :: Pact.Native.PactConsumer.MessageInteractionBuilder.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 test_name( builder :: Pact.Native.PactConsumer.MessageInteractionBuilder.t(), name :: String.t() ) :: Pact.Native.PactConsumer.MessageInteractionBuilder.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 with_key( buider :: Pact.Native.PactConsumer.MessageInteractionBuilder.t(), key :: String.t() ) :: Pact.Native.PactConsumer.MessageInteractionBuilder.t()
Specify a unique key for this interaction. This key will be used to determine equality of the interaction, so must be unique.