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 forResponses without specific header.static <T> org.hamcrest.Matcher<com.spotify.apollo.Response<T>>hasHeader(String header, org.hamcrest.Matcher<String> valueMatcher)Builds a matcher forResponses with matching header.static <T> org.hamcrest.Matcher<com.spotify.apollo.Response<T>>hasNoHeaders()Builds a matcher forResponses with no headers.static <T> org.hamcrest.Matcher<com.spotify.apollo.Response<T>>hasNoPayload()Builds a matcher forResponses with no payload.static <T> org.hamcrest.Matcher<com.spotify.apollo.Response<? super T>>hasPayload(org.hamcrest.Matcher<? super T> payloadMatcher)Builds a matcher forResponses 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 forResponses with matching status.
-
-
-
Method Detail
-
hasNoHeaders
public static <T> org.hamcrest.Matcher<com.spotify.apollo.Response<T>> hasNoHeaders()
Builds a matcher forResponses 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 forResponses with matching header.- Parameters:
header- The header to match.valueMatcher-Matcherfor the corresponding value.- Returns:
- A matcher
-
doesNotHaveHeader
public static <T> org.hamcrest.Matcher<com.spotify.apollo.Response<T>> doesNotHaveHeader(String header)
Builds a matcher forResponses 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 forResponses 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 forResponses with matching payload.- Parameters:
payloadMatcher-Matcherfor 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 forResponses with matching status.- Parameters:
statusMatcher-Matcherfor the status.- Returns:
- A matcher
-
-