Class ResponseMatchers


  • public final class ResponseMatchers
    extends Object
    Provides Hamcrest matcher utilities for matching Response.
    • 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 for Responses without specific header.
      static <T> org.hamcrest.Matcher<com.spotify.apollo.Response<T>> hasHeader​(String header, org.hamcrest.Matcher<String> valueMatcher)
      Builds a matcher for Responses with matching header.
      static <T> org.hamcrest.Matcher<com.spotify.apollo.Response<T>> hasNoHeaders()
      Builds a matcher for Responses with no headers.
      static <T> org.hamcrest.Matcher<com.spotify.apollo.Response<T>> hasNoPayload()
      Builds a matcher for Responses with no payload.
      static <T> org.hamcrest.Matcher<com.spotify.apollo.Response<? super T>> hasPayload​(org.hamcrest.Matcher<? super T> payloadMatcher)
      Builds a matcher for Responses 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 for Responses with matching status.
    • Method Detail

      • hasNoHeaders

        public static <T> org.hamcrest.Matcher<com.spotify.apollo.Response<T>> hasNoHeaders()
        Builds a matcher for Responses 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 for Responses 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 for Responses 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 for Responses 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 for Responses 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 for Responses with matching status.
        Parameters:
        statusMatcher - Matcher for the status.
        Returns:
        A matcher