Class MessageInteractionBuilder
-
- All Implemented Interfaces:
public class MessageInteractionBuilderPact Message builder DSL that supports V4 formatted Pact files
-
-
Field Summary
Fields Modifier and Type Field Description private final V4Interaction.AsynchronousMessageinteraction
-
Constructor Summary
Constructors Constructor Description MessageInteractionBuilder(String description, List<ProviderState> providerStates, List<JsonValue.StringValue> comments)
-
Method Summary
Modifier and Type Method Description final V4Interaction.AsynchronousMessagegetInteraction()final MessageInteractionBuilderkey(String key)Sets the unique key for the interaction. final MessageInteractionBuilderdescription(String description)Sets the interaction description final MessageInteractionBuilderstate(String stateDescription, Map<String, Object> params)Adds a provider state to the interaction. final MessageInteractionBuilderstate(String stateDescription)Adds a provider state to the interaction. final MessageInteractionBuilderstate(String stateDescription, String paramKey, Object paramValue)Adds a provider state to the interaction with a parameter. final MessageInteractionBuilderstate(String stateDescription, Pair<String, Object> params)Adds a provider state to the interaction with parameters a pairs of key/values. final MessageInteractionBuilderpending(Boolean pending)Marks the interaction as pending. final MessageInteractionBuildercomment(String comment)Adds a text comment to the interaction final MessageInteractionBuilderreference(String group, String name, Object value)Adds an external reference for the interaction. final MessageInteractionBuilderwithContents(Function1<MessageContentsBuilder, MessageContentsBuilder> builderFn)Build the contents of the interaction using a contents builder final V4Interactionbuild()-
-
Method Detail
-
getInteraction
final V4Interaction.AsynchronousMessage getInteraction()
-
key
final MessageInteractionBuilder key(String key)
Sets the unique key for the interaction. If this is not set, or is empty, a key will be calculated from the contents of the interaction.
-
description
final MessageInteractionBuilder description(String description)
Sets the interaction description
-
state
@JvmOverloads() final MessageInteractionBuilder state(String stateDescription, Map<String, Object> params)
Adds a provider state to the interaction.
-
state
@JvmOverloads() final MessageInteractionBuilder state(String stateDescription)
Adds a provider state to the interaction.
-
state
final MessageInteractionBuilder state(String stateDescription, String paramKey, Object paramValue)
Adds a provider state to the interaction with a parameter.
-
state
final MessageInteractionBuilder state(String stateDescription, Pair<String, Object> params)
Adds a provider state to the interaction with parameters a pairs of key/values.
-
pending
final MessageInteractionBuilder pending(Boolean pending)
Marks the interaction as pending.
-
comment
final MessageInteractionBuilder comment(String comment)
Adds a text comment to the interaction
-
reference
final MessageInteractionBuilder reference(String group, String name, Object value)
Adds an external reference for the interaction. The reference will be stored in the Pact file comments under the group key. For instance, you could store the OpenAPI operation ID that the interaction corresponds to as an external reference.
-
withContents
final MessageInteractionBuilder withContents(Function1<MessageContentsBuilder, MessageContentsBuilder> builderFn)
Build the contents of the interaction using a contents builder
-
build
final V4Interaction build()
-
-
-
-