Class MessageStubMapping.Builder
java.lang.Object
com.github.tomakehurst.wiremock.message.MessageStubMapping.Builder
- All Implemented Interfaces:
MessageStubMappingBuilder
- Enclosing class:
- MessageStubMapping
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionatPriority(Integer priority) Sets the priority for this message stub mapping.build()Builds the MessageStubMapping from the current builder state.longonChannelFromRequestMatching(ChannelType channelType, RequestPattern requestPattern) onChannelFromRequestMatching(ChannelType channelType, RequestPatternBuilder channelPatternBuilder) onChannelFromRequestMatching(ChannelType channelType, String urlPath) onWebsocketChannelFromRequestMatching(RequestPatternBuilder channelPatternBuilder) setInsertionIndex(long insertionIndex) triggeredByHttpRequest(RequestPattern requestPattern) triggeredByHttpRequest(RequestPatternBuilder requestPatternBuilder) triggeredByHttpStub(String stubId) triggeredByHttpStub(UUID stubId) triggersAction(MessageAction action) willTriggerActions(MessageAction... actions) Configures the actions to trigger when this stub matches.withActions(List<MessageAction> actions) withBody(ContentPattern<?> bodyPattern) Sets the unique identifier for this message stub mapping.withMessageBody(StringValuePattern messagePattern) Sets a pattern to match the message content.withMetadata(Metadata metadata) Sets metadata for this message stub mapping.withMetadata(Metadata.Builder metadata) Sets metadata for this message stub mapping.withMetadata(Map<String, ?> metadataMap) Sets metadata for this message stub mapping.Sets a human-readable name for this message stub mapping.withPriority(Integer priority)
-
Constructor Details
-
Builder
public Builder() -
Builder
-
-
Method Details
-
withId
Description copied from interface:MessageStubMappingBuilderSets the unique identifier for this message stub mapping.- Specified by:
withIdin interfaceMessageStubMappingBuilder- Parameters:
id- the UUID to assign- Returns:
- this builder
-
withName
Description copied from interface:MessageStubMappingBuilderSets a human-readable name for this message stub mapping.- Specified by:
withNamein interfaceMessageStubMappingBuilder- Parameters:
name- the name to assign- Returns:
- this builder
-
atPriority
Description copied from interface:MessageStubMappingBuilderSets the priority for this message stub mapping. Lower numbers indicate higher priority.- Specified by:
atPriorityin interfaceMessageStubMappingBuilder- Parameters:
priority- the priority value- Returns:
- this builder
-
withPriority
-
withMessageBody
Description copied from interface:MessageStubMappingBuilderSets a pattern to match the message content.- Specified by:
withMessageBodyin interfaceMessageStubMappingBuilder- Parameters:
messagePattern- the pattern to match against incoming messages- Returns:
- this builder
-
onWebsocketChannelFromRequestMatching
-
onWebsocketChannelFromRequestMatching
public MessageStubMapping.Builder onWebsocketChannelFromRequestMatching(RequestPatternBuilder channelPatternBuilder) -
onChannelFromRequestMatching
public MessageStubMapping.Builder onChannelFromRequestMatching(ChannelType channelType, String urlPath) -
onChannelFromRequestMatching
public MessageStubMapping.Builder onChannelFromRequestMatching(ChannelType channelType, RequestPatternBuilder channelPatternBuilder) -
onChannelFromRequestMatching
public MessageStubMapping.Builder onChannelFromRequestMatching(ChannelType channelType, RequestPattern requestPattern) -
withBody
-
triggeredByHttpStub
-
triggeredByHttpStub
-
triggeredByHttpRequest
-
triggeredByHttpRequest
public MessageStubMapping.Builder triggeredByHttpRequest(RequestPatternBuilder requestPatternBuilder) -
withActions
-
willTriggerActions
Description copied from interface:MessageStubMappingBuilderConfigures the actions to trigger when this stub matches. This method terminates the builder chain and returns the built MessageStubMapping.- Specified by:
willTriggerActionsin interfaceMessageStubMappingBuilder- Parameters:
actions- the actions to execute when matched- Returns:
- the built MessageStubMapping
-
triggersAction
-
withMetadata
Description copied from interface:MessageStubMappingBuilderSets metadata for this message stub mapping.- Specified by:
withMetadatain interfaceMessageStubMappingBuilder- Parameters:
metadataMap- the metadata map- Returns:
- this builder
-
withMetadata
Description copied from interface:MessageStubMappingBuilderSets metadata for this message stub mapping.- Specified by:
withMetadatain interfaceMessageStubMappingBuilder- Parameters:
metadata- the metadata object- Returns:
- this builder
-
withMetadata
Description copied from interface:MessageStubMappingBuilderSets metadata for this message stub mapping.- Specified by:
withMetadatain interfaceMessageStubMappingBuilder- Parameters:
metadata- the metadata builder- Returns:
- this builder
-
getInsertionIndex
public long getInsertionIndex() -
setInsertionIndex
-
build
Description copied from interface:MessageStubMappingBuilderBuilds the MessageStubMapping from the current builder state.- Specified by:
buildin interfaceMessageStubMappingBuilder- Returns:
- the built MessageStubMapping
-