Class HttpResponseExpectation


  • public class HttpResponseExpectation
    extends Object
    Common expectations for HTTP responses.
    Author:
    Julien Viet
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static <H extends HttpResponseHead>
      io.reactivex.SingleTransformer<H,​H>
      contentType​(String mimeType)
      Creates an expectation validating the response has a content-type header matching the mimeType.
      static <H extends HttpResponseHead>
      io.reactivex.SingleTransformer<H,​H>
      contentType​(String... mimeTypes)
      Creates an expectation validating the response has a content-type header matching one of the mimeTypes.
      static <H extends HttpResponseHead>
      io.reactivex.SingleTransformer<H,​H>
      contentType​(List<String> mimeTypes)
      Creates an expectation validating the response has a content-type header matching one of the mimeTypes.
      static <H extends HttpResponseHead>
      io.reactivex.SingleTransformer<H,​H>
      status​(int statusCode)
      Creates an expectation asserting that the status response code is equal to statusCode.
      static <H extends HttpResponseHead>
      io.reactivex.SingleTransformer<H,​H>
      status​(int min, int max)
      Creates an expectation asserting that the status response code is between to min (inclusive) and max (exclusive).
    • Method Detail

      • status

        public static <H extends HttpResponseHead> io.reactivex.SingleTransformer<H,​H> status​(int statusCode)
        Creates an expectation asserting that the status response code is equal to statusCode.
        Parameters:
        statusCode - the expected status code
      • status

        public static <H extends HttpResponseHead> io.reactivex.SingleTransformer<H,​H> status​(int min,
                                                                                                    int max)
        Creates an expectation asserting that the status response code is between to min (inclusive) and max (exclusive).
        Parameters:
        min - the min status code
        max - the max status code
      • contentType

        public static <H extends HttpResponseHead> io.reactivex.SingleTransformer<H,​H> contentType​(String mimeType)
        Creates an expectation validating the response has a content-type header matching the mimeType.
        Parameters:
        mimeType - the mime type
      • contentType

        public static <H extends HttpResponseHead> io.reactivex.SingleTransformer<H,​H> contentType​(String... mimeTypes)
        Creates an expectation validating the response has a content-type header matching one of the mimeTypes.
        Parameters:
        mimeTypes - the list of mime types
      • contentType

        public static <H extends HttpResponseHead> io.reactivex.SingleTransformer<H,​H> contentType​(List<String> mimeTypes)
        Creates an expectation validating the response has a content-type header matching one of the mimeTypes.
        Parameters:
        mimeTypes - the list of mime types