-
- All Implemented Interfaces:
public final class MessageContentsBuilderDSL builder for the message contents part of a V4 message
-
-
Field Summary
Fields Modifier and Type Field Description private MessageContentscontents
-
Constructor Summary
Constructors Constructor Description MessageContentsBuilder(MessageContents contents)
-
Method Summary
Modifier and Type Method Description final MessageContentsgetContents()final UnitsetContents(MessageContents contents)final MessageContentsBuilderwithMetadata(Map<String, Object> metadata)Adds the expected metadata to the message contents final MessageContentsBuilderwithMetadata(Consumer<MetadataBuilder> consumer)Adds the expected metadata to the message using a builder final MessageContentsBuilderwithContent(DslPart body)Adds the JSON body as the message content final MessageContentsBuilderwithContent(PactXmlBuilder xmlBuilder)Adds the XML body as the message content final MessageContentsBuilderwithContent(String payload, String contentType)Adds the string as the message contents with the given content type -
-
Method Detail
-
getContents
final MessageContents getContents()
-
setContents
final Unit setContents(MessageContents contents)
-
withMetadata
final MessageContentsBuilder withMetadata(Map<String, Object> metadata)
Adds the expected metadata to the message contents
-
withMetadata
final MessageContentsBuilder withMetadata(Consumer<MetadataBuilder> consumer)
Adds the expected metadata to the message using a builder
-
withContent
final MessageContentsBuilder withContent(DslPart body)
Adds the JSON body as the message content
-
withContent
final MessageContentsBuilder withContent(PactXmlBuilder xmlBuilder)
Adds the XML body as the message content
-
withContent
final MessageContentsBuilder withContent(String payload, String contentType)
Adds the string as the message contents with the given content type
-
-
-
-