ApiResponse
object is returned from the withRequest
method, it can be used to verify that the response is valid.
ApiResponse
class to verify the response body and status code:
verifyBooleanField
: Verifies the boolean field in response body.verifyHeader
: Verifies the header in response.verifyIntField
: Verifies the integer field in response body.verifySchema
: Verifies the response body against the given schema.verifyStatusCode
: Verifies the status code of response.verifyStatusMessage
: Verifies the status message of response.verifyTextField
: Verifies the text field in response body.ApiResponse
class to get response data:
getResponseData (expression)
: Returns the response data as String.getResponseData (expression, type)
: Returns the response data as per the specified class type.ApiResponse
class uses Google Truth library and exposes it’s methods to verify the response.
:::