Package net.officefloor.woof.mock
Interface MockWoofResponse
-
- All Superinterfaces:
MockHttpResponse
- All Known Implementing Classes:
MockWoofServer.MockWoofResponseImpl
public interface MockWoofResponse extends MockHttpResponse
MockHttpResponse
with additional assertions.- Author:
- Daniel Sagenschneider
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
assertJson(int statusCode, java.lang.Object entity, com.fasterxml.jackson.databind.ObjectMapper mapper, java.lang.String... headerNameValuePairs)
Asserts the JSON response providing customObjectMapper
.void
assertJson(int statusCode, java.lang.Object entity, java.lang.String... headerNameValuePairs)
Asserts the JSON response.void
assertJsonError(int httpStatus, java.lang.Throwable failure, java.lang.String... headerNameValuePairs)
Asserts a JSON error.void
assertJsonError(java.lang.Throwable failure, java.lang.String... headerNameValuePairs)
Asserts a JSON error.<T> T
getJson(int statusCode, java.lang.Class<T> clazz)
Obtains the JSON object from HTTP payload.<T> T
getJson(int statusCode, java.lang.Class<T> clazz, com.fasterxml.jackson.databind.ObjectMapper mapper)
Obtains the JSON object from HTTP payload using customObjectMapper
.-
Methods inherited from interface net.officefloor.server.http.mock.MockHttpResponse
assertCookie, assertHeader, assertResponse, assertStatus, assertStatus, getCookie, getCookies, getEntity, getEntity, getHeader, getHeaders, getStatus, getVersion
-
-
-
-
Method Detail
-
getJson
<T> T getJson(int statusCode, java.lang.Class<T> clazz)
Obtains the JSON object from HTTP payload.- Type Parameters:
T
- Type of object.- Parameters:
statusCode
-HttpStatus
.clazz
-Class
for the JSON object.- Returns:
- JSON object.
-
getJson
<T> T getJson(int statusCode, java.lang.Class<T> clazz, com.fasterxml.jackson.databind.ObjectMapper mapper)
Obtains the JSON object from HTTP payload using customObjectMapper
.- Type Parameters:
T
- Type of object.- Parameters:
statusCode
-HttpStatus
.clazz
-Class
for the JSON object.mapper
- CustomObjectMapper
.- Returns:
- JSON object.
-
assertJson
void assertJson(int statusCode, java.lang.Object entity, java.lang.String... headerNameValuePairs)
Asserts the JSON response.- Parameters:
statusCode
-HttpStatus
.entity
-Object
to be written as JSON.headerNameValuePairs
- ExpectedHttpHeader
name/value pairs.
-
assertJson
void assertJson(int statusCode, java.lang.Object entity, com.fasterxml.jackson.databind.ObjectMapper mapper, java.lang.String... headerNameValuePairs)
Asserts the JSON response providing customObjectMapper
.- Parameters:
statusCode
-HttpStatus
.entity
-Object
to be written as JSON.mapper
- CustomObjectMapper
.headerNameValuePairs
- ExpectedHttpHeader
name/value pairs.
-
assertJsonError
void assertJsonError(java.lang.Throwable failure, java.lang.String... headerNameValuePairs)
Asserts a JSON error.- Parameters:
failure
- Cause.headerNameValuePairs
- ExpectedHttpHeader
name/value pairs.
-
assertJsonError
void assertJsonError(int httpStatus, java.lang.Throwable failure, java.lang.String... headerNameValuePairs)
Asserts a JSON error.- Parameters:
httpStatus
- ExpectedHttpStatus
.failure
- Cause.headerNameValuePairs
- ExpectedHttpHeader
name/value pairs.
-
-