Package com.spotify.apollo.test.unit
Class StatusTypeMatchers
- java.lang.Object
-
- com.spotify.apollo.test.unit.StatusTypeMatchers
-
public final class StatusTypeMatchers extends Object
Provides Hamcrest matcher utilities for matchingStatusType
.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static org.hamcrest.Matcher<com.spotify.apollo.StatusType>
belongsToFamily(com.spotify.apollo.StatusType.Family family)
Builds a matcher forStatusType
s belonging to aStatusType.Family
.static org.hamcrest.Matcher<com.spotify.apollo.StatusType>
withCode(int code)
Builds a matcher forStatusType
s with specified status code.static org.hamcrest.Matcher<com.spotify.apollo.StatusType>
withCode(com.spotify.apollo.StatusType code)
Builds a matcher forStatusType
s whoseStatusType.code()
matches the specifiedStatusType
's status code.static org.hamcrest.Matcher<com.spotify.apollo.StatusType>
withReasonPhrase(org.hamcrest.Matcher<String> reasonPhraseMatcher)
Builds a matcher forStatusType
s with matching reason phrase.
-
-
-
Method Detail
-
belongsToFamily
public static org.hamcrest.Matcher<com.spotify.apollo.StatusType> belongsToFamily(com.spotify.apollo.StatusType.Family family)
Builds a matcher forStatusType
s belonging to aStatusType.Family
.- Parameters:
family
- TheStatusType.Family
to match.- Returns:
- A matcher
-
withReasonPhrase
public static org.hamcrest.Matcher<com.spotify.apollo.StatusType> withReasonPhrase(org.hamcrest.Matcher<String> reasonPhraseMatcher)
Builds a matcher forStatusType
s with matching reason phrase.- Parameters:
reasonPhraseMatcher
-Matcher
for the reason phrase.- Returns:
- A matcher
-
withCode
public static org.hamcrest.Matcher<com.spotify.apollo.StatusType> withCode(int code)
Builds a matcher forStatusType
s with specified status code.- Parameters:
code
- The status code to match.- Returns:
- A matcher
-
withCode
public static org.hamcrest.Matcher<com.spotify.apollo.StatusType> withCode(com.spotify.apollo.StatusType code)
Builds a matcher forStatusType
s whoseStatusType.code()
matches the specifiedStatusType
's status code. Reason phrases are not included in the comparison.- Parameters:
code
- The StatusType whose code should match.
-
-