Class OutputMessage
- java.lang.Object
-
- org.springframework.cloud.contract.spec.internal.Common
-
- org.springframework.cloud.contract.spec.internal.OutputMessage
-
public class OutputMessage extends Common
Represents an output for messaging. Used for verifying the body and headers that are sent.- Since:
- 1.0.0
- Author:
- Marcin Grzejszczak, Tim Ysewyn
-
-
Constructor Summary
Constructors Constructor Description OutputMessage()OutputMessage(OutputMessage outputMessage)
-
Method Summary
-
Methods inherited from class org.springframework.cloud.contract.spec.internal.Common
$, $, $, $, aDouble, alphaNumeric, anInteger, anyBoolean, assertThatSidesMatch, c, client, consumer, convertObjectsToDslProperties, convertObjectsToDslProperties, email, execute, file, file, fileAsBytes, hostname, httpsUrl, ipAddress, iso8601WithOffset, isoDate, isoDateTime, isoTime, named, named, named, nonBlank, nonEmpty, number, onlyAlphaUnicode, optional, p, positiveInt, producer, regex, regex, regex, server, stub, test, toDslProperty, toDslProperty, toDslProperty, toDslProperty, url, uuid, value, value, value, value
-
-
-
-
Constructor Detail
-
OutputMessage
public OutputMessage()
-
OutputMessage
public OutputMessage(OutputMessage outputMessage)
-
-
Method Detail
-
sentTo
public void sentTo(String sentTo)
-
sentTo
public void sentTo(DslProperty sentTo)
-
body
public void body(Object bodyAsValue)
-
body
public void body(DslProperty bodyAsValue)
-
assertThat
public void assertThat(String assertThat)
-
value
public DslProperty value(ServerDslProperty serverDslProperty)
-
$
public DslProperty $(ServerDslProperty property)
-
$
public DslProperty $(Pattern pattern)
-
$
public DslProperty $(RegexProperty pattern)
-
value
public DslProperty value(RegexProperty pattern)
-
$
public DslProperty $(OptionalProperty property)
-
regexProperty
public RegexProperty regexProperty(Object object)
- Overrides:
regexPropertyin classCommon
-
getProperty
public org.springframework.cloud.contract.spec.internal.OutputMessage.ServerPatternValueDslProperty getProperty()
-
setProperty
public void setProperty(org.springframework.cloud.contract.spec.internal.OutputMessage.ServerPatternValueDslProperty property)
-
getSentTo
public DslProperty<String> getSentTo()
-
setSentTo
public void setSentTo(DslProperty<String> sentTo)
-
getHeaders
public Headers getHeaders()
-
setHeaders
public void setHeaders(Headers headers)
-
getBody
public DslProperty getBody()
-
setBody
public void setBody(DslProperty body)
-
getAssertThat
public ExecutionProperty getAssertThat()
-
setAssertThat
public void setAssertThat(ExecutionProperty assertThat)
-
getBodyMatchers
public ResponseBodyMatchers getBodyMatchers()
-
setBodyMatchers
public void setBodyMatchers(ResponseBodyMatchers bodyMatchers)
-
anyAlphaUnicode
public ServerDslProperty anyAlphaUnicode()
-
anyAlphaNumeric
public ServerDslProperty anyAlphaNumeric()
-
anyNumber
public ServerDslProperty anyNumber()
-
anyInteger
public ServerDslProperty anyInteger()
-
anyPositiveInt
public ServerDslProperty anyPositiveInt()
-
anyDouble
public ServerDslProperty anyDouble()
-
anyHex
public ServerDslProperty anyHex()
-
aBoolean
public ServerDslProperty aBoolean()
-
anyIpAddress
public ServerDslProperty anyIpAddress()
-
anyHostname
public ServerDslProperty anyHostname()
-
anyEmail
public ServerDslProperty anyEmail()
-
anyUrl
public ServerDslProperty anyUrl()
-
anyHttpsUrl
public ServerDslProperty anyHttpsUrl()
-
anyUuid
public ServerDslProperty anyUuid()
-
anyDate
public ServerDslProperty anyDate()
-
anyDateTime
public ServerDslProperty anyDateTime()
-
anyTime
public ServerDslProperty anyTime()
-
anyIso8601WithOffset
public ServerDslProperty anyIso8601WithOffset()
-
anyNonBlankString
public ServerDslProperty anyNonBlankString()
-
anyNonEmptyString
public ServerDslProperty anyNonEmptyString()
-
anyOf
public ServerDslProperty anyOf(String... values)
-
headers
public void headers(Consumer<Headers> consumer)
The message headers part of the contract.- Parameters:
consumer- function to manipulate the message headers
-
bodyMatchers
public void bodyMatchers(Consumer<ResponseBodyMatchers> consumer)
The stub matchers part of the contract.- Parameters:
consumer- function to manipulate the body matchers
-
headers
public void headers(@DelegatesTo(Headers.class) groovy.lang.Closure consumer)
The message headers part of the contract.- Parameters:
consumer- function to manipulate the message headers
-
bodyMatchers
public void bodyMatchers(@DelegatesTo(ResponseBodyMatchers.class) groovy.lang.Closure consumer)
The stub matchers part of the contract.- Parameters:
consumer- function to manipulate the body matchers
-
-