Package au.com.dius.pact.consumer.dsl
Class SynchronousMessagePactBuilder
-
- All Implemented Interfaces:
public final class SynchronousMessagePactBuilder
PACT DSL builder for v4 specification synchronous request/response messages
-
-
Constructor Summary
Constructors Constructor Description SynchronousMessagePactBuilder(PactSpecVersion specVersion)
SynchronousMessagePactBuilder(Consumer consumer, Provider provider, List<ProviderState> providerStates, List<V4Interaction.SynchronousMessages> messages, PactSpecVersion specVersion)
SynchronousMessagePactBuilder(Consumer consumer, Provider provider, List<ProviderState> providerStates, List<V4Interaction.SynchronousMessages> messages)
SynchronousMessagePactBuilder(Consumer consumer, Provider provider, List<ProviderState> providerStates)
SynchronousMessagePactBuilder(Consumer consumer, Provider provider)
SynchronousMessagePactBuilder(Consumer consumer)
SynchronousMessagePactBuilder()
-
Method Summary
Modifier and Type Method Description final SynchronousMessagePactBuilder
consumer(String consumer)
Name the consumer of the pact final SynchronousMessagePactBuilder
hasPactWith(String provider)
Name the provider that the consumer has a pact with. final SynchronousMessagePactBuilder
given(String providerState)
Sets the provider state. final SynchronousMessagePactBuilder
given(String providerState, Map<String, Object> params)
Sets the provider state. final SynchronousMessagePactBuilder
given(ProviderState providerState)
Sets the provider state. final SynchronousMessagePactBuilder
expectsToReceive(String description)
Adds a message expectation to the pact. final SynchronousMessagePactBuilder
withRequest(Consumer<MessageContentsBuilder> callback)
Adds the expected request message to the interaction final SynchronousMessagePactBuilder
withResponse(Consumer<MessageContentsBuilder> callback)
Adds the expected response message to the interaction. final <P extends Pact> P
toPact(Class<P> pactClass)
Terminates the DSL and builds a pact to represent the interactions final V4Pact
toPact()
Convert this builder into a Pact -
-
Constructor Detail
-
SynchronousMessagePactBuilder
SynchronousMessagePactBuilder(PactSpecVersion specVersion)
-
SynchronousMessagePactBuilder
SynchronousMessagePactBuilder(Consumer consumer, Provider provider, List<ProviderState> providerStates, List<V4Interaction.SynchronousMessages> messages, PactSpecVersion specVersion)
-
SynchronousMessagePactBuilder
SynchronousMessagePactBuilder(Consumer consumer, Provider provider, List<ProviderState> providerStates, List<V4Interaction.SynchronousMessages> messages)
-
SynchronousMessagePactBuilder
SynchronousMessagePactBuilder(Consumer consumer, Provider provider, List<ProviderState> providerStates)
-
SynchronousMessagePactBuilder
SynchronousMessagePactBuilder(Consumer consumer, Provider provider)
-
SynchronousMessagePactBuilder
SynchronousMessagePactBuilder(Consumer consumer)
-
SynchronousMessagePactBuilder
SynchronousMessagePactBuilder()
-
-
Method Detail
-
consumer
final SynchronousMessagePactBuilder consumer(String consumer)
Name the consumer of the pact
- Parameters:
consumer
- Consumer name
-
hasPactWith
final SynchronousMessagePactBuilder hasPactWith(String provider)
Name the provider that the consumer has a pact with.
- Parameters:
provider
- provider name
-
given
final SynchronousMessagePactBuilder given(String providerState)
Sets the provider state.
- Parameters:
providerState
- description of the provider state
-
given
final SynchronousMessagePactBuilder given(String providerState, Map<String, Object> params)
Sets the provider state.
- Parameters:
providerState
- description of the provider stateparams
- key/value pairs to describe state
-
given
final SynchronousMessagePactBuilder given(ProviderState providerState)
Sets the provider state.
- Parameters:
providerState
- state of the provider
-
expectsToReceive
final SynchronousMessagePactBuilder expectsToReceive(String description)
Adds a message expectation to the pact.
- Parameters:
description
- message description.
-
withRequest
final SynchronousMessagePactBuilder withRequest(Consumer<MessageContentsBuilder> callback)
Adds the expected request message to the interaction
-
withResponse
final SynchronousMessagePactBuilder withResponse(Consumer<MessageContentsBuilder> callback)
Adds the expected response message to the interaction. Calling this multiple times will add a new response message for each call.
-
toPact
final <P extends Pact> P toPact(Class<P> pactClass)
Terminates the DSL and builds a pact to represent the interactions
-
toPact
final V4Pact toPact()
Convert this builder into a Pact
-
-
-
-