Class ValidatableMockMvcResponseImpl
java.lang.Object
io.restassured.internal.ValidatableResponseOptionsImpl<ValidatableMockMvcResponse,MockMvcResponse>
io.restassured.module.mockmvc.internal.ValidatableMockMvcResponseImpl
- All Implemented Interfaces:
ValidatableMockMvcResponse,io.restassured.response.ValidatableResponseLogSpec<ValidatableMockMvcResponse,,MockMvcResponse> io.restassured.response.ValidatableResponseOptions<ValidatableMockMvcResponse,MockMvcResponse>
public class ValidatableMockMvcResponseImpl
extends io.restassured.internal.ValidatableResponseOptionsImpl<ValidatableMockMvcResponse,MockMvcResponse>
implements ValidatableMockMvcResponse
-
Field Summary
Fields inherited from class io.restassured.internal.ValidatableResponseOptionsImpl
response, responseSpec -
Constructor Summary
ConstructorsConstructorDescriptionValidatableMockMvcResponseImpl(org.springframework.test.web.servlet.ResultActions resultActions, String contentType, io.restassured.internal.ResponseParserRegistrar rpr, io.restassured.config.RestAssuredConfig config, MockMvcResponse response, io.restassured.response.ExtractableResponse<MockMvcResponse> extractableResponse, io.restassured.internal.log.LogRepository logRepository) -
Method Summary
Modifier and TypeMethodDescriptionapply(org.springframework.test.web.servlet.ResultHandler resultHandler, org.springframework.test.web.servlet.ResultHandler... resultHandlers) Apply one or more result handlers.assertThat(org.springframework.test.web.servlet.ResultMatcher resultMatcher) Assert that aResultMatchermatches the response.expect(org.springframework.test.web.servlet.ResultMatcher resultMatcher) Expect aResultMatcherto match the response.status(org.springframework.http.HttpStatus expectedStatus) Validate that the response status matches an Spring-Framework HttpStatus.Methods inherited from class io.restassured.internal.ValidatableResponseOptionsImpl
all, all, and, appendRootPath, appendRootPath, assertThat, body, body, body, body, body, body, body, body, body, content, contentType, contentType, contentType, cookie, cookie, cookie, cookie, cookies, cookies, cookies, defaultParser, detachRootPath, everything, everything, extract, header, header, header, header, headers, headers, headers, ifError, ifStatusCodeIsEqualTo, ifStatusCodeMatches, ifValidationFails, ifValidationFails, ifValidationFails, log, noRoot, noRootPath, onFailMessage, parser, root, root, rootPath, rootPath, spec, status, statusCode, statusCode, statusLine, statusLine, time, time, usingMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.restassured.response.ValidatableResponseOptions
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, onFailMessage, parser, root, root, rootPath, rootPath, spec, statusCode, statusCode, statusLine, statusLine, time, time, using
-
Constructor Details
-
ValidatableMockMvcResponseImpl
public ValidatableMockMvcResponseImpl(org.springframework.test.web.servlet.ResultActions resultActions, String contentType, io.restassured.internal.ResponseParserRegistrar rpr, io.restassured.config.RestAssuredConfig config, MockMvcResponse response, io.restassured.response.ExtractableResponse<MockMvcResponse> extractableResponse, io.restassured.internal.log.LogRepository logRepository)
-
-
Method Details
-
expect
public ValidatableMockMvcResponse expect(org.springframework.test.web.servlet.ResultMatcher resultMatcher) Description copied from interface:ValidatableMockMvcResponseExpect aResultMatcherto match the response.Note same as
ValidatableMockMvcResponse.assertThat(org.springframework.test.web.servlet.ResultMatcher)but a different syntax.- Specified by:
expectin interfaceValidatableMockMvcResponse- Parameters:
resultMatcher- The result matcher- Returns:
- The
ValidatableMockMvcResponseinstance.
-
assertThat
public ValidatableMockMvcResponse assertThat(org.springframework.test.web.servlet.ResultMatcher resultMatcher) Description copied from interface:ValidatableMockMvcResponseAssert that aResultMatchermatches the response.Note same as
ValidatableMockMvcResponse.expect(org.springframework.test.web.servlet.ResultMatcher)but a different syntax.- Specified by:
assertThatin interfaceValidatableMockMvcResponse- Parameters:
resultMatcher- The result matcher- Returns:
- The
ValidatableMockMvcResponseinstance.
-
apply
public ValidatableMockMvcResponse apply(org.springframework.test.web.servlet.ResultHandler resultHandler, org.springframework.test.web.servlet.ResultHandler... resultHandlers) Description copied from interface:ValidatableMockMvcResponseApply one or more result handlers.- Specified by:
applyin interfaceValidatableMockMvcResponse- Parameters:
resultHandler- The first result handlerresultHandlers- Additional result handlers to add (optional)- Returns:
- The
ValidatableMockMvcResponseinstance.
-
status
Description copied from interface:ValidatableMockMvcResponseValidate that the response status matches an Spring-Framework HttpStatus. E.g.get("/something").then().assertThat().status(HttpStatus.OK);- Specified by:
statusin interfaceValidatableMockMvcResponse- Parameters:
expectedStatus- The expected status.- Returns:
- the response specification
-
originalResponse
- Specified by:
originalResponsein classio.restassured.internal.ValidatableResponseOptionsImpl<ValidatableMockMvcResponse,MockMvcResponse>
-