public interface ValidatableMockMvcResponse extends io.restassured.response.ValidatableResponseOptions<ValidatableMockMvcResponse,MockMvcResponse>
Usage example:
get("/lotto").then().body("lotto.lottoId", is(5));
Modifier and Type | Method and Description |
---|---|
ValidatableMockMvcResponse |
apply(org.springframework.test.web.servlet.ResultHandler resultHandler,
org.springframework.test.web.servlet.ResultHandler... resultHandlers)
Apply one or more result handlers.
|
ValidatableMockMvcResponse |
assertThat(org.springframework.test.web.servlet.ResultMatcher resultMatcher)
Assert that a
ResultMatcher matches the response. |
ValidatableMockMvcResponse |
expect(org.springframework.test.web.servlet.ResultMatcher resultMatcher)
Expect a
ResultMatcher to match the response. |
ValidatableMockMvcResponse |
status(org.springframework.http.HttpStatus expectedStatus)
Validate that the response status matches an Spring-Framework HttpStatus.
|
and, appendRoot, appendRoot, appendRootPath, appendRootPath, assertThat, body, body, body, body, body, body, body, contentType, contentType, contentType, cookie, cookie, cookie, cookie, cookies, cookies, defaultParser, detachRoot, detachRootPath, extract, header, header, header, header, headers, headers, log, noRoot, noRootPath, parser, root, root, rootPath, rootPath, spec, statusCode, statusCode, statusLine, statusLine, time, time, using
ValidatableMockMvcResponse expect(org.springframework.test.web.servlet.ResultMatcher resultMatcher)
ResultMatcher
to match the response.
Note same as assertThat(org.springframework.test.web.servlet.ResultMatcher)
but a different syntax.
resultMatcher
- The result matcherValidatableMockMvcResponse
instance.ValidatableMockMvcResponse assertThat(org.springframework.test.web.servlet.ResultMatcher resultMatcher)
ResultMatcher
matches the response.
Note same as expect(org.springframework.test.web.servlet.ResultMatcher)
but a different syntax.
resultMatcher
- The result matcherValidatableMockMvcResponse
instance.ValidatableMockMvcResponse apply(org.springframework.test.web.servlet.ResultHandler resultHandler, org.springframework.test.web.servlet.ResultHandler... resultHandlers)
resultHandler
- The first result handlerresultHandlers
- Additional result handlers to add (optional)ValidatableMockMvcResponse
instance.ValidatableMockMvcResponse status(org.springframework.http.HttpStatus expectedStatus)
get("/something").then().assertThat().status(HttpStatus.OK);
expectedStatus
- The expected status.Copyright © 2010–2019. All rights reserved.