public class Utils extends Object
| Modifier and Type | Method and Description |
|---|---|
static void |
assertStatus(org.apache.http.HttpResponse response,
Status expected)
|
static <K> K |
convert(org.apache.http.HttpResponse response,
com.fasterxml.jackson.core.type.TypeReference<K> type)
Converts http response into entity
|
public static <K> K convert(org.apache.http.HttpResponse response,
com.fasterxml.jackson.core.type.TypeReference<K> type)
throws EvrythngException
K - entity typeresponse - HttpResponse instancetype - TypeReference instanceEvrythngExceptionpublic static void assertStatus(org.apache.http.HttpResponse response,
Status expected)
throws EvrythngException
expected Status against the provided
HttpResponse. If actual response Status does not
match expected one, then response entity
will be mapped to an ErrorMessage instance and an exception will
be thrown.response - the HttpResponse holding a valid status codeexpected - the expected response status codeEvrythngException - if provided response Status does not match
expected oneCopyright © 2016 EVRYTHNG Ltd London / Zurich. All rights reserved.