public class WisdomUnitTest extends Object implements org.wisdom.api.http.Status
| Modifier and Type | Field and Description |
|---|---|
private static String |
JSON_ERROR |
static com.fasterxml.jackson.databind.ObjectMapper |
MAPPER
The object mapper used for JSON.
|
ACCEPTED, BAD_GATEWAY, BAD_REQUEST, CONFLICT, CONTINUE, CREATED, EXPECTATION_FAILED, FORBIDDEN, FOUND, GATEWAY_TIMEOUT, GONE, HTTP_VERSION_NOT_SUPPORTED, INTERNAL_SERVER_ERROR, LENGTH_REQUIRED, METHOD_NOT_ALLOWED, MOVED_PERMANENTLY, MULTIPLE_CHOICES, NO_CONTENT, NON_AUTHORITATIVE_INFORMATION, NOT_ACCEPTABLE, NOT_FOUND, NOT_IMPLEMENTED, NOT_MODIFIED, OK, PARTIAL_CONTENT, PAYMENT_REQUIRED, PRECONDITION_FAILED, PROXY_AUTHENTICATION_REQUIRED, REQUEST_ENTITY_TOO_LARGE, REQUEST_TIMEOUT, REQUEST_URI_TOO_LONG, REQUESTED_RANGE_NOT_SATISFIABLE, RESET_CONTENT, SEE_OTHER, SERVICE_UNAVAILABLE, SWITCHING_PROTOCOLS, TEMPORARY_REDIRECT, UNAUTHORIZED, UNSUPPORTED_MEDIA_TYPE, USE_PROXY| Constructor and Description |
|---|
WisdomUnitTest() |
| Modifier and Type | Method and Description |
|---|---|
String |
contentType(Action.ActionResult result)
Helper method retrieving the mime-type of the response to an action.
|
static org.wisdom.api.http.FileItem |
from(File file)
Helper method to build a
FileItem from a File object. |
static org.wisdom.api.http.FileItem |
from(File file,
String field)
Helper method to build a
FileItem from a File object. |
com.fasterxml.jackson.databind.node.ObjectNode |
json(Action.ActionResult result)
Helper method to get the content of the response as Object Node.
|
com.fasterxml.jackson.databind.node.ArrayNode |
jsonarray(Action.ActionResult result)
Helper method to get the content of the response as Array Node.
|
int |
status(Action.ActionResult result)
Helper method retrieving the status code of the response to an action.
|
byte[] |
toBytes(Action.ActionResult result)
Helper method to get the content of the response as byte array.
|
String |
toString(Action.ActionResult result)
Helper method to get the content of the response as String.
|
public static final com.fasterxml.jackson.databind.ObjectMapper MAPPER
private static final String JSON_ERROR
public static org.wisdom.api.http.FileItem from(File file)
FileItem from a File object.file - the filepublic static org.wisdom.api.http.FileItem from(File file, String field)
FileItem from a File object.file - the filefield - the field name of the form having sent the filepublic int status(Action.ActionResult result)
result - the result object from which the status code is extracted. Must not be null.public String contentType(Action.ActionResult result)
result - the result object from which the mime-type is extracted. Must not be null.public com.fasterxml.jackson.databind.node.ObjectNode json(Action.ActionResult result)
result - the result object from which the content is extracted. Must not be null.IllegalArgumentException - if the JSON Node cannot be retrieved or built.public com.fasterxml.jackson.databind.node.ArrayNode jsonarray(Action.ActionResult result)
result - the result object from which the content is extracted. Must not be null.IllegalArgumentException - if the JSON Node cannot be retrieved or built.public String toString(Action.ActionResult result)
result - the result object from which the content is extracted. Must not be null.IllegalArgumentException - if the String form cannot be retrieved.public byte[] toBytes(Action.ActionResult result)
result - the result object from which the content is extracted. Must not be null.IllegalArgumentException - if the byte array cannot be retrieved.Copyright © 2013–2014 Wisdom Framework. All rights reserved.