public class HttpResponseAssert<T> extends org.assertj.core.api.AbstractAssert<HttpResponseAssert<T>,HttpResponse<T>>
HttpResponse.| Modifier | Constructor and Description |
|---|---|
protected |
HttpResponseAssert(HttpResponse<T> actual) |
| Modifier and Type | Method and Description |
|---|---|
static <T> HttpResponseAssert<T> |
assertThat(HttpResponse<T> actual)
Creates an
HttpResponseAssert instance. |
HttpResponseAssert<T> |
bodyMatches(String regex)
Checks that the Http Response body matches the given regex.
|
HttpResponseAssert<T> |
hasBody()
Checks that the actual HTTP response has a body (content).
|
HttpResponseAssert<T> |
hasBody(T body)
Checks that the Http Response has the given body.
|
HttpResponseAssert<T> |
hasCharset(Charset charset)
Checks that the Http Response body has the given charset.
|
HttpResponseAssert<T> |
hasContentType(String contentType)
Checks that the Http Response has the given `content-type`.
|
HttpResponseAssert<T> |
hasCookie(String cookieName)
Checks that the Http Response contains a cookie named `cookieName`.
|
HttpResponseAssert<T> |
hasCookie(String cookieName,
String value)
Checks that the Http Response contains a cookie named `cookieName` and has the value `value`.
|
HttpResponseAssert<T> |
hasHeader(String key)
Checks that the Http Response contains a header named `key`.
|
HttpResponseAssert<T> |
hasHeader(String key,
String value)
Checks that the Http Response contains a header named `key` and has the value `value`.
|
HttpResponseAssert<T> |
hasHeaders()
Checks that the actual HTTP response has at least one headers.
|
HttpResponseAssert<T> |
hasInBody(String inBody)
Checks that the Http Response contains the given String in its body.
|
HttpResponseAssert<T> |
hasJsonNumericField(String path,
double value)
Checks that the Http Response contains a numeric value at the given Json Pointer (JavaScript Object Notation
(JSON) Pointer).
|
HttpResponseAssert<T> |
hasJsonNumericField(String path,
int value)
Checks that the Http Response contains a numeric value at the given Json Pointer (JavaScript Object Notation
(JSON) Pointer).
|
HttpResponseAssert<T> |
hasJsonNumericField(String path,
long value)
Checks that the Http Response contains a numeric value at the given Json Pointer (JavaScript Object Notation
(JSON) Pointer).
|
HttpResponseAssert<T> |
hasJsonTextField(String path,
String value)
Checks that the Http Response contains a textual value at the given Json Pointer (JavaScript Object Notation
(JSON) Pointer).
|
HttpResponseAssert<T> |
hasJsonTextFieldContaining(String path,
String... values)
Checks that the Http Response contains a textual value at the given Json Pointer (JavaScript Object Notation
(JSON) Pointer) containing the given values.
|
HttpResponseAssert<T> |
hasLength(int length)
Checks that the Http Response body has the given length.
|
HttpResponseAssert<T> |
hasNotInBody(String inBody)
Checks that the Http Response does not contains the given String in its body.
|
HttpResponseAssert<T> |
hasStatus(int status)
Checks that the actual HTTP response has the given HTTP Status.
|
HttpResponseAssert<T> |
isJson()
Checks that the actual HTTP response has returned a content type that is
applicaiton/json. |
as, as, asList, asString, describedAs, describedAs, descriptionText, doesNotHave, doesNotHaveSameClassAs, equals, failWithMessage, getWritableAssertionInfo, has, hashCode, hasSameClassAs, inBinary, inHexadecimal, is, isEqualTo, isExactlyInstanceOf, isIn, isIn, isInstanceOf, isInstanceOfAny, isNot, isNotEqualTo, isNotExactlyInstanceOf, isNotIn, isNotIn, isNotInstanceOf, isNotInstanceOfAny, isNotNull, isNotOfAnyClassIn, isNotSameAs, isNull, isOfAnyClassIn, isSameAs, overridingErrorMessage, usingComparator, usingDefaultComparator, withThreadDumpOnErrorprotected HttpResponseAssert(HttpResponse<T> actual)
public static <T> HttpResponseAssert<T> assertThat(HttpResponse<T> actual)
HttpResponseAssert instance.T - the type of contentactual - the HTTP Responsepublic HttpResponseAssert<T> hasHeader(String key, String value)
key - the expected header namevalue - the expected valueHttpResponseAssertpublic HttpResponseAssert<T> hasHeader(String key)
key - the expected header nameHttpResponseAssertpublic HttpResponseAssert<T> hasCookie(String cookieName)
cookieName - the expected cookie nameHttpResponseAssertpublic HttpResponseAssert<T> hasCookie(String cookieName, String value)
cookieName - the expected cookie namevalue - the expected valueHttpResponseAssertpublic HttpResponseAssert<T> hasContentType(String contentType)
contentType - the expected content typeHttpResponseAssertpublic HttpResponseAssert<T> hasInBody(String inBody)
inBody - expected snippetHttpResponseAssertpublic HttpResponseAssert<T> hasNotInBody(String inBody)
inBody - expected snippetHttpResponseAssertpublic HttpResponseAssert<T> bodyMatches(String regex)
regex - the regexHttpResponseAssertpublic HttpResponseAssert<T> hasBody(T body)
body - the expected bodyHttpResponseAssertpublic HttpResponseAssert<T> hasLength(int length)
length - the expected lengthHttpResponseAssertpublic HttpResponseAssert<T> hasCharset(Charset charset)
charset - the expected charsetHttpResponseAssertpublic HttpResponseAssert<T> hasHeaders()
HttpResponseAssertpublic HttpResponseAssert<T> hasBody()
HttpResponseAssertpublic HttpResponseAssert<T> hasStatus(int status)
status - the expected statusHttpResponseAssertpublic HttpResponseAssert<T> hasJsonTextField(String path, String value)
path - the Json Pointervalue - the expected valueHttpResponseAssertpublic HttpResponseAssert<T> hasJsonTextFieldContaining(String path, String... values)
path - the Json Pointervalues - the expected valuesHttpResponseAssertpublic HttpResponseAssert<T> hasJsonNumericField(String path, int value)
path - the Json Pointervalue - the expected valueHttpResponseAssertpublic HttpResponseAssert<T> hasJsonNumericField(String path, long value)
path - the Json Pointervalue - the expected valueHttpResponseAssertpublic HttpResponseAssert<T> hasJsonNumericField(String path, double value)
path - the Json Pointervalue - the expected valueHttpResponseAssertpublic HttpResponseAssert<T> isJson()
applicaiton/json.HttpResponseAssertCopyright © 2013–2015 Wisdom Framework. All rights reserved.