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 forStatusTypes belonging to aStatusType.Family.static org.hamcrest.Matcher<com.spotify.apollo.StatusType>withCode(int code)Builds a matcher forStatusTypes with specified status code.static org.hamcrest.Matcher<com.spotify.apollo.StatusType>withCode(com.spotify.apollo.StatusType code)Builds a matcher forStatusTypes 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 forStatusTypes 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 forStatusTypes belonging to aStatusType.Family.- Parameters:
family- TheStatusType.Familyto match.- Returns:
- A matcher
-
withReasonPhrase
public static org.hamcrest.Matcher<com.spotify.apollo.StatusType> withReasonPhrase(org.hamcrest.Matcher<String> reasonPhraseMatcher)
Builds a matcher forStatusTypes with matching reason phrase.- Parameters:
reasonPhraseMatcher-Matcherfor the reason phrase.- Returns:
- A matcher
-
withCode
public static org.hamcrest.Matcher<com.spotify.apollo.StatusType> withCode(int code)
Builds a matcher forStatusTypes 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 forStatusTypes whoseStatusType.code()matches the specifiedStatusType's status code. Reason phrases are not included in the comparison.- Parameters:
code- The StatusType whose code should match.
-
-