Package com.spotify.apollo.test.unit
Class ResponseMatchers
- java.lang.Object
-
- com.spotify.apollo.test.unit.ResponseMatchers
-
public final class ResponseMatchers extends Object
Provides Hamcrest matcher utilities for matchingResponse
.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> org.hamcrest.Matcher<com.spotify.apollo.Response<T>>
doesNotHaveHeader(String header)
Builds a matcher forResponse
s without specific header.static <T> org.hamcrest.Matcher<com.spotify.apollo.Response<T>>
hasHeader(String header, org.hamcrest.Matcher<String> valueMatcher)
Builds a matcher forResponse
s with matching header.static <T> org.hamcrest.Matcher<com.spotify.apollo.Response<T>>
hasNoHeaders()
Builds a matcher forResponse
s with no headers.static <T> org.hamcrest.Matcher<com.spotify.apollo.Response<T>>
hasNoPayload()
Builds a matcher forResponse
s with no payload.static <T> org.hamcrest.Matcher<com.spotify.apollo.Response<? super T>>
hasPayload(org.hamcrest.Matcher<? super T> payloadMatcher)
Builds a matcher forResponse
s with matching payload.static <T> org.hamcrest.Matcher<com.spotify.apollo.Response<T>>
hasStatus(org.hamcrest.Matcher<com.spotify.apollo.StatusType> statusMatcher)
Builds a matcher forResponse
s with matching status.
-
-
-
Method Detail
-
hasNoHeaders
public static <T> org.hamcrest.Matcher<com.spotify.apollo.Response<T>> hasNoHeaders()
Builds a matcher forResponse
s with no headers.- Returns:
- A matcher
-
hasHeader
public static <T> org.hamcrest.Matcher<com.spotify.apollo.Response<T>> hasHeader(String header, org.hamcrest.Matcher<String> valueMatcher)
Builds a matcher forResponse
s with matching header.- Parameters:
header
- The header to match.valueMatcher
-Matcher
for the corresponding value.- Returns:
- A matcher
-
doesNotHaveHeader
public static <T> org.hamcrest.Matcher<com.spotify.apollo.Response<T>> doesNotHaveHeader(String header)
Builds a matcher forResponse
s without specific header.- Parameters:
header
- Name of the unwanted header.- Returns:
- A matcher
-
hasNoPayload
public static <T> org.hamcrest.Matcher<com.spotify.apollo.Response<T>> hasNoPayload()
Builds a matcher forResponse
s with no payload.- Returns:
- A matcher
-
hasPayload
public static <T> org.hamcrest.Matcher<com.spotify.apollo.Response<? super T>> hasPayload(org.hamcrest.Matcher<? super T> payloadMatcher)
Builds a matcher forResponse
s with matching payload.- Parameters:
payloadMatcher
-Matcher
for the payload.- Returns:
- A matcher
-
hasStatus
public static <T> org.hamcrest.Matcher<com.spotify.apollo.Response<T>> hasStatus(org.hamcrest.Matcher<com.spotify.apollo.StatusType> statusMatcher)
Builds a matcher forResponse
s with matching status.- Parameters:
statusMatcher
-Matcher
for the status.- Returns:
- A matcher
-
-