public class Verifiers
Abstract class for using static functions to verify response.
| Modifier and Type | Class and Description |
|---|---|
static class |
Verifiers.Companion |
| Modifier and Type | Field and Description |
|---|---|
static Verifiers.Companion |
Companion |
| Constructor and Description |
|---|
Verifiers()
Abstract class for using static functions to verify response.
|
| Modifier and Type | Method and Description |
|---|---|
static Verifier |
body(org.hamcrest.Matcher<?> matcher,
org.hamcrest.Matcher additionalMatchers)
Verify response body.
|
static Verifier |
contentTypeIs(java.lang.String contentType)
Verify response body content type.
|
static Verifier |
contentTypeIs(ContentType contentType)
Verify response body content type.
|
static Verifier |
header(java.lang.String name,
org.hamcrest.Matcher<?> matcher)
Verify response header.
|
static Verifier |
headers(java.util.Map<java.lang.String,?> expectedHeaders)
Verify response headers.
|
static Verifier |
headers(java.lang.String firstExpectedHeaderName,
java.lang.Object firstExpectedHeaderValue,
java.lang.Object expectedHeaders)
Verify response headers.
|
static Verifier |
jsonSchema(java.lang.String jsonSchema)
Verify response body using JSON schema validation.
|
static Verifier |
path(java.lang.String key,
org.hamcrest.Matcher<?> matcher,
java.lang.Object additionalKeyMatcherPairs)
Verify response body path.
|
static Verifier |
statusCode(int statusCode)
Verify response status code.
|
static Verifier |
statusCode(StatusCode statusCode)
Verify response status code.
|
static Verifier |
time(org.hamcrest.Matcher<java.lang.Long> matcher)
Verify the response time (in milliseconds).
|
static Verifier |
time(org.hamcrest.Matcher<java.lang.Long> matcher,
java.util.concurrent.TimeUnit timeUnit)
Verify the response time (in milliseconds).
|
public static Verifiers.Companion Companion
public Verifiers()
Abstract class for using static functions to verify response.
public static Verifier statusCode(int statusCode)
Verify response status code.
statusCode - of your responseSpecification.public static Verifier statusCode(StatusCode statusCode)
Verify response status code.
statusCode - of your responseSpecification.public static Verifier jsonSchema(java.lang.String jsonSchema)
Verify response body using JSON schema validation.
jsonSchema - of expected responseSpecification body.public static Verifier path(java.lang.String key, org.hamcrest.Matcher<?> matcher, java.lang.Object additionalKeyMatcherPairs)
Verify response body path.
key - of your responseSpecification body.matcher - for verifying.additionalKeyMatcherPairs - for verifying.public static Verifier body(org.hamcrest.Matcher<?> matcher, org.hamcrest.Matcher additionalMatchers)
Verify response body.
matcher - for verifying.additionalMatchers - for verifying.public static Verifier contentTypeIs(java.lang.String contentType)
Verify response body content type.
contentType - of response body content type.public static Verifier contentTypeIs(ContentType contentType)
Verify response body content type.
contentType - of response body content type.public static Verifier header(java.lang.String name, org.hamcrest.Matcher<?> matcher)
Verify response header.
name - of header.matcher - of responseSpecification header.public static Verifier headers(java.util.Map<java.lang.String,?> expectedHeaders)
Verify response headers.
expectedHeaders - of responseSpecification.public static Verifier headers(java.lang.String firstExpectedHeaderName, java.lang.Object firstExpectedHeaderValue, java.lang.Object expectedHeaders)
Verify response headers.
firstExpectedHeaderName - of responseSpecification.firstExpectedHeaderValue - of responseSpecification.expectedHeaders - list of responseSpecification (expected "header name" - "header value" pairs).public static Verifier time(org.hamcrest.Matcher<java.lang.Long> matcher)
Verify the response time (in milliseconds).
matcher - request response time.public static Verifier time(org.hamcrest.Matcher<java.lang.Long> matcher, java.util.concurrent.TimeUnit timeUnit)
Verify the response time (in milliseconds).
matcher - request response time.timeUnit - of response.