Package net.officefloor.woof.mock
Interface MockWoofResponse
-
- All Superinterfaces:
MockHttpResponse
- All Known Implementing Classes:
MockWoofServer.MockWoofResponseImpl
public interface MockWoofResponse extends MockHttpResponse
MockHttpResponsewith additional assertions.- Author:
- Daniel Sagenschneider
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidassertJson(int statusCode, java.lang.Object entity, com.fasterxml.jackson.databind.ObjectMapper mapper, java.lang.String... headerNameValuePairs)Asserts the JSON response providing customObjectMapper.voidassertJson(int statusCode, java.lang.Object entity, java.lang.String... headerNameValuePairs)Asserts the JSON response.voidassertJsonError(int httpStatus, java.lang.Throwable failure, java.lang.String... headerNameValuePairs)Asserts a JSON error.voidassertJsonError(java.lang.Throwable failure, java.lang.String... headerNameValuePairs)Asserts a JSON error.<T> TgetJson(int statusCode, java.lang.Class<T> clazz)Obtains the JSON object from HTTP payload.<T> TgetJson(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-Classfor 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-Classfor 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-Objectto be written as JSON.headerNameValuePairs- ExpectedHttpHeadername/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-Objectto be written as JSON.mapper- CustomObjectMapper.headerNameValuePairs- ExpectedHttpHeadername/value pairs.
-
assertJsonError
void assertJsonError(java.lang.Throwable failure, java.lang.String... headerNameValuePairs)Asserts a JSON error.- Parameters:
failure- Cause.headerNameValuePairs- ExpectedHttpHeadername/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- ExpectedHttpHeadername/value pairs.
-
-