public class Response extends Common
Modifier and Type | Method and Description |
---|---|
DslProperty |
$(Pattern server)
Allows to set a dynamic value for the given element.
|
DslProperty |
$(RegexProperty server)
Allows to set a dynamic value for the given element.
|
DslProperty |
$(ServerDslProperty server)
Allows to set a dynamic value for the given element.
|
ServerDslProperty |
aBoolean() |
int |
ACCEPTED() |
int |
ALREADY_REPORTED() |
ServerDslProperty |
anyAlphaNumeric() |
ServerDslProperty |
anyAlphaUnicode() |
ServerDslProperty |
anyDate() |
ServerDslProperty |
anyDateTime() |
ServerDslProperty |
anyDouble() |
ServerDslProperty |
anyEmail() |
ServerDslProperty |
anyHex() |
ServerDslProperty |
anyHostname() |
ServerDslProperty |
anyHttpsUrl() |
ServerDslProperty |
anyInteger() |
ServerDslProperty |
anyIpAddress() |
ServerDslProperty |
anyIso8601WithOffset() |
ServerDslProperty |
anyNonBlankString() |
ServerDslProperty |
anyNonEmptyString() |
ServerDslProperty |
anyNumber() |
ServerDslProperty |
anyOf(String... values) |
ServerDslProperty |
anyPositiveInt() |
ServerDslProperty |
anyTime() |
ServerDslProperty |
anyUrl() |
ServerDslProperty |
anyUuid() |
void |
assertThatSidesMatch(Object stubSide,
Object testSide) |
void |
async()
Turns on the asynchronous mode for this contract.
|
int |
BAD_GATEWAY() |
int |
BAD_REQUEST() |
int |
BANDWIDTH_LIMIT_EXCEEDED() |
void |
body(List body)
Allows set an HTTP body.
|
void |
body(Map<String,Object> body)
Allows set an HTTP body.
|
void |
body(Object bodyAsValue)
Allows set an HTTP body.
|
void |
bodyMatchers(groovy.lang.Closure consumer)
Allows to set matchers for the body.
|
void |
bodyMatchers(Consumer<ResponseBodyMatchers> consumer)
Allows to set matchers for the body.
|
int |
CHECKPOINT() |
int |
CONFLICT() |
int |
CONTINUE() |
void |
cookies(groovy.lang.Closure consumer)
Allows to configure HTTP cookies.
|
void |
cookies(Consumer<Cookies> consumer)
Allows to configure HTTP cookies.
|
int |
CREATED() |
int |
DESTINATION_LOCKED()
Deprecated.
|
boolean |
equals(Object o) |
int |
EXPECTATION_FAILED() |
int |
FAILED_DEPENDENCY() |
void |
fixedDelayMilliseconds(int timeInMilliseconds)
Allows to set a fixed delay of the response in milliseconds.
|
int |
FORBIDDEN() |
int |
FOUND() |
FromRequest |
fromRequest()
Allows to reference entries from the request.
|
int |
GATEWAY_TIMEOUT() |
boolean |
getAsync() |
Body |
getBody() |
ResponseBodyMatchers |
getBodyMatchers() |
Cookies |
getCookies() |
DslProperty |
getDelay() |
Headers |
getHeaders() |
org.springframework.cloud.contract.spec.internal.Response.ServerPatternValueDslProperty |
getProperty() |
DslProperty |
getStatus() |
int |
GONE() |
int |
hashCode() |
void |
headers(groovy.lang.Closure consumer)
Allows to configure HTTP headers.
|
void |
headers(Consumer<Headers> consumer)
Allows to configure HTTP headers.
|
int |
HTTP_VERSION_NOT_SUPPORTED() |
int |
I_AM_A_TEAPOT() |
int |
IM_USED() |
int |
INSUFFICIENT_SPACE_ON_RESOURCE()
Deprecated.
|
int |
INSUFFICIENT_STORAGE() |
int |
INTERNAL_SERVER_ERROR() |
boolean |
isAsync() |
int |
LENGTH_REQUIRED() |
int |
LOCKED() |
int |
LOOP_DETECTED() |
int |
METHOD_FAILURE()
Deprecated.
|
int |
METHOD_NOT_ALLOWED() |
int |
MOVED_PERMANENTLY() |
int |
MOVED_TEMPORARILY()
Deprecated.
|
int |
MULTI_STATUS() |
int |
MULTIPLE_CHOICES() |
int |
NETWORK_AUTHENTICATION_REQUIRED() |
int |
NO_CONTENT() |
int |
NON_AUTHORITATIVE_INFORMATION() |
int |
NOT_ACCEPTABLE() |
int |
NOT_EXTENDED() |
int |
NOT_FOUND() |
int |
NOT_IMPLEMENTED() |
int |
NOT_MODIFIED() |
int |
OK() |
int |
PARTIAL_CONTENT() |
int |
PAYLOAD_TOO_LARGE() |
int |
PAYMENT_REQUIRED() |
int |
PERMANENT_REDIRECT() |
int |
PRECONDITION_FAILED() |
int |
PRECONDITION_REQUIRED() |
int |
PROCESSING() |
int |
PROXY_AUTHENTICATION_REQUIRED() |
RegexProperty |
regexProperty(Object object) |
int |
REQUEST_ENTITY_TOO_LARGE()
Deprecated.
|
int |
REQUEST_HEADER_FIELDS_TOO_LARGE() |
int |
REQUEST_TIMEOUT() |
int |
REQUEST_URI_TOO_LONG()
Deprecated.
|
int |
REQUESTED_RANGE_NOT_SATISFIABLE() |
int |
RESET_CONTENT() |
int |
SEE_OTHER() |
int |
SERVICE_UNAVAILABLE() |
void |
setAsync(boolean async) |
void |
setBody(Body body) |
void |
setBodyMatchers(ResponseBodyMatchers bodyMatchers) |
void |
setCookies(Cookies cookies) |
void |
setDelay(DslProperty delay) |
void |
setHeaders(Headers headers) |
void |
setProperty(org.springframework.cloud.contract.spec.internal.Response.ServerPatternValueDslProperty property) |
void |
setStatus(DslProperty status) |
void |
status(DslProperty status)
Allows to set the HTTP status.
|
void |
status(int status)
Allows to set the HTTP status.
|
int |
SWITCHING_PROTOCOLS() |
int |
TEMPORARY_REDIRECT() |
void |
testMatchers(groovy.lang.Closure consumer)
Deprecated.
Deprecated in favor of bodyMatchers to support other future
bodyMatchers too
|
void |
testMatchers(Consumer<ResponseBodyMatchers> consumer)
Deprecated.
Deprecated in favor of bodyMatchers to support other future
bodyMatchers too
|
int |
TOO_MANY_REQUESTS() |
String |
toString() |
int |
UNAUTHORIZED() |
int |
UNAVAILABLE_FOR_LEGAL_REASONS() |
int |
UNPROCESSABLE_ENTITY() |
int |
UNSUPPORTED_MEDIA_TYPE() |
int |
UPGRADE_REQUIRED() |
int |
URI_TOO_LONG() |
int |
USE_PROXY()
Deprecated.
|
DslProperty |
value(ClientDslProperty client,
ServerDslProperty server)
Allows to set a dynamic value for the given element.
|
DslProperty |
value(Pattern server)
Allows to set a dynamic value for the given element.
|
DslProperty |
value(RegexProperty server)
Allows to set a dynamic value for the given element.
|
DslProperty |
value(ServerDslProperty server)
Allows to set a dynamic value for the given element.
|
DslProperty |
value(ServerDslProperty server,
ClientDslProperty client)
Allows to set a dynamic value for the given element.
|
int |
VARIANT_ALSO_NEGOTIATES() |
$, $, $, $, aDouble, alphaNumeric, anInteger, anyBoolean, 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
public Response()
public Response(Response response)
public void status(int status)
status
- HTTP statuspublic void status(DslProperty status)
status
- HTTP statuspublic void body(Map<String,Object> body)
body
- body to setpublic void body(List body)
body
- body to setpublic void body(Object bodyAsValue)
bodyAsValue
- body to setpublic void fixedDelayMilliseconds(int timeInMilliseconds)
timeInMilliseconds
- delay in millispublic void async()
public void assertThatSidesMatch(Object stubSide, Object testSide)
assertThatSidesMatch
in class Common
public DslProperty value(ServerDslProperty server)
server
- server valuepublic DslProperty $(ServerDslProperty server)
server
- server valuepublic DslProperty value(Pattern server)
server
- server valuepublic DslProperty value(RegexProperty server)
server
- server valuepublic DslProperty $(RegexProperty server)
server
- server valuepublic DslProperty $(Pattern server)
server
- server valuepublic RegexProperty regexProperty(Object object)
regexProperty
in class Common
public FromRequest fromRequest()
public DslProperty value(ClientDslProperty client, ServerDslProperty server)
public DslProperty value(ServerDslProperty server, ClientDslProperty client)
public org.springframework.cloud.contract.spec.internal.Response.ServerPatternValueDslProperty getProperty()
public void setProperty(org.springframework.cloud.contract.spec.internal.Response.ServerPatternValueDslProperty property)
public DslProperty getStatus()
public void setStatus(DslProperty status)
public DslProperty getDelay()
public void setDelay(DslProperty delay)
public Headers getHeaders()
public void setHeaders(Headers headers)
public Cookies getCookies()
public void setCookies(Cookies cookies)
public Body getBody()
public void setBody(Body body)
public boolean getAsync()
public boolean isAsync()
public void setAsync(boolean async)
public ResponseBodyMatchers getBodyMatchers()
public void setBodyMatchers(ResponseBodyMatchers bodyMatchers)
public ServerDslProperty anyAlphaUnicode()
public ServerDslProperty anyAlphaNumeric()
public ServerDslProperty anyNumber()
public ServerDslProperty anyInteger()
public ServerDslProperty anyPositiveInt()
public ServerDslProperty anyDouble()
public ServerDslProperty anyHex()
public ServerDslProperty aBoolean()
public ServerDslProperty anyIpAddress()
public ServerDslProperty anyHostname()
public ServerDslProperty anyEmail()
public ServerDslProperty anyUrl()
public ServerDslProperty anyHttpsUrl()
public ServerDslProperty anyUuid()
public ServerDslProperty anyDate()
public ServerDslProperty anyDateTime()
public ServerDslProperty anyTime()
public ServerDslProperty anyIso8601WithOffset()
public ServerDslProperty anyNonBlankString()
public ServerDslProperty anyNonEmptyString()
public ServerDslProperty anyOf(String... values)
public int CONTINUE()
public int SWITCHING_PROTOCOLS()
public int PROCESSING()
public int CHECKPOINT()
public int OK()
public int CREATED()
public int ACCEPTED()
public int NON_AUTHORITATIVE_INFORMATION()
public int NO_CONTENT()
public int RESET_CONTENT()
public int PARTIAL_CONTENT()
public int MULTI_STATUS()
public int ALREADY_REPORTED()
public int IM_USED()
public int MULTIPLE_CHOICES()
public int MOVED_PERMANENTLY()
public int FOUND()
@Deprecated public int MOVED_TEMPORARILY()
public int SEE_OTHER()
public int NOT_MODIFIED()
@Deprecated public int USE_PROXY()
public int TEMPORARY_REDIRECT()
public int PERMANENT_REDIRECT()
public int BAD_REQUEST()
public int UNAUTHORIZED()
public int PAYMENT_REQUIRED()
public int FORBIDDEN()
public int NOT_FOUND()
public int METHOD_NOT_ALLOWED()
public int NOT_ACCEPTABLE()
public int PROXY_AUTHENTICATION_REQUIRED()
public int REQUEST_TIMEOUT()
public int CONFLICT()
public int GONE()
public int LENGTH_REQUIRED()
public int PRECONDITION_FAILED()
public int PAYLOAD_TOO_LARGE()
@Deprecated public int REQUEST_ENTITY_TOO_LARGE()
public int URI_TOO_LONG()
@Deprecated public int REQUEST_URI_TOO_LONG()
public int UNSUPPORTED_MEDIA_TYPE()
public int REQUESTED_RANGE_NOT_SATISFIABLE()
public int EXPECTATION_FAILED()
public int I_AM_A_TEAPOT()
@Deprecated public int INSUFFICIENT_SPACE_ON_RESOURCE()
@Deprecated public int METHOD_FAILURE()
@Deprecated public int DESTINATION_LOCKED()
public int UNPROCESSABLE_ENTITY()
public int LOCKED()
public int FAILED_DEPENDENCY()
public int UPGRADE_REQUIRED()
public int PRECONDITION_REQUIRED()
public int TOO_MANY_REQUESTS()
public int REQUEST_HEADER_FIELDS_TOO_LARGE()
public int UNAVAILABLE_FOR_LEGAL_REASONS()
public int INTERNAL_SERVER_ERROR()
public int NOT_IMPLEMENTED()
public int BAD_GATEWAY()
public int SERVICE_UNAVAILABLE()
public int GATEWAY_TIMEOUT()
public int HTTP_VERSION_NOT_SUPPORTED()
public int VARIANT_ALSO_NEGOTIATES()
public int INSUFFICIENT_STORAGE()
public int LOOP_DETECTED()
public int BANDWIDTH_LIMIT_EXCEEDED()
public int NOT_EXTENDED()
public int NETWORK_AUTHENTICATION_REQUIRED()
public void headers(Consumer<Headers> consumer)
consumer
- function to manipulate the URLpublic void cookies(Consumer<Cookies> consumer)
consumer
- function to manipulate the URL@Deprecated public void testMatchers(Consumer<ResponseBodyMatchers> consumer)
consumer
- function to manipulate the URLpublic void bodyMatchers(Consumer<ResponseBodyMatchers> consumer)
consumer
- function to manipulate the URLpublic void headers(@DelegatesTo(value=Headers.class) groovy.lang.Closure consumer)
consumer
- function to manipulate the URLpublic void cookies(@DelegatesTo(value=Cookies.class) groovy.lang.Closure consumer)
consumer
- function to manipulate the URL@Deprecated public void testMatchers(@DelegatesTo(value=ResponseBodyMatchers.class) groovy.lang.Closure consumer)
consumer
- function to manipulate the URLpublic void bodyMatchers(@DelegatesTo(value=ResponseBodyMatchers.class) groovy.lang.Closure consumer)
consumer
- function to manipulate the URLCopyright © 2016–2019 Spring. All rights reserved.