public class MessagePactBuilder
PACT DSL builder for v3 specification
| Modifier and Type | Class and Description |
|---|---|
static class |
MessagePactBuilder.Companion |
| Modifier and Type | Field and Description |
|---|---|
static MessagePactBuilder.Companion |
Companion |
| Constructor and Description |
|---|
MessagePactBuilder(au.com.dius.pact.model.Consumer consumer,
au.com.dius.pact.model.Provider provider,
java.util.List<au.com.dius.pact.model.ProviderState> providerStates,
java.util.List<au.com.dius.pact.model.v3.messaging.Message> messages)
PACT DSL builder for v3 specification
|
| Modifier and Type | Method and Description |
|---|---|
static MessagePactBuilder |
consumer(java.lang.String consumer)
Name the consumer of the pact
|
MessagePactBuilder |
expectsToReceive(java.lang.String description)
Adds a message expectation in the pact.
|
MessagePactBuilder |
given(java.lang.String providerState)
Sets the provider state.
|
MessagePactBuilder |
hasPactWith(java.lang.String provider)
Name the provider that the consumer has a pact with.
|
au.com.dius.pact.model.v3.messaging.MessagePact |
toPact()
Convert this builder into a Pact
|
MessagePactBuilder |
withContent(au.com.dius.pact.consumer.dsl.DslPart body)
Adds the JSON body as the message content
|
MessagePactBuilder |
withMetadata(java.util.Map<java.lang.String,? extends java.lang.Object> metadata)
Adds the expected metadata to the message
|
public static MessagePactBuilder.Companion Companion
public MessagePactBuilder(au.com.dius.pact.model.Consumer consumer,
au.com.dius.pact.model.Provider provider,
java.util.List<au.com.dius.pact.model.ProviderState> providerStates,
java.util.List<au.com.dius.pact.model.v3.messaging.Message> messages)
PACT DSL builder for v3 specification
consumer - The consumer for the pact.provider - The provider for the pact.providerStates - Provider statesmessages - Messages for the pactpublic MessagePactBuilder hasPactWith(java.lang.String provider)
Name the provider that the consumer has a pact with.
provider - provider namepublic MessagePactBuilder given(java.lang.String providerState)
Sets the provider state.
providerState - state of the providerpublic MessagePactBuilder expectsToReceive(java.lang.String description)
Adds a message expectation in the pact.
description - message description.public MessagePactBuilder withMetadata(java.util.Map<java.lang.String,? extends java.lang.Object> metadata)
Adds the expected metadata to the message
public MessagePactBuilder withContent(au.com.dius.pact.consumer.dsl.DslPart body)
Adds the JSON body as the message content
public au.com.dius.pact.model.v3.messaging.MessagePact toPact()
Convert this builder into a Pact
public static MessagePactBuilder consumer(java.lang.String consumer)
Name the consumer of the pact
consumer - Consumer name