Interface MockWoofResponse

    • Method Detail

      • getJson

        <T> T getJson​(int statusCode,
                      java.lang.Class<T> clazz)
        Obtains the JSON object from HTTP payload.
        Type Parameters:
        T - Type of object.
        Parameters:
        statusCode - HttpStatus.
        clazz - Class for the JSON object.
        Returns:
        JSON object.
      • getJson

        <T> T getJson​(int statusCode,
                      java.lang.Class<T> clazz,
                      com.fasterxml.jackson.databind.ObjectMapper mapper)
        Obtains the JSON object from HTTP payload using custom ObjectMapper.
        Type Parameters:
        T - Type of object.
        Parameters:
        statusCode - HttpStatus.
        clazz - Class for the JSON object.
        mapper - Custom ObjectMapper.
        Returns:
        JSON object.
      • assertJson

        void assertJson​(int statusCode,
                        java.lang.Object entity,
                        java.lang.String... headerNameValuePairs)
        Asserts the JSON response.
        Parameters:
        statusCode - HttpStatus.
        entity - Object to be written as JSON.
        headerNameValuePairs - Expected HttpHeader name/value pairs.
      • assertJson

        void assertJson​(int statusCode,
                        java.lang.Object entity,
                        com.fasterxml.jackson.databind.ObjectMapper mapper,
                        java.lang.String... headerNameValuePairs)
        Asserts the JSON response providing custom ObjectMapper.
        Parameters:
        statusCode - HttpStatus.
        entity - Object to be written as JSON.
        mapper - Custom ObjectMapper.
        headerNameValuePairs - Expected HttpHeader name/value pairs.
      • assertJsonError

        void assertJsonError​(java.lang.Throwable failure,
                             java.lang.String... headerNameValuePairs)
        Asserts a JSON error.
        Parameters:
        failure - Cause.
        headerNameValuePairs - Expected HttpHeader name/value pairs.
      • assertJsonError

        void assertJsonError​(int httpStatus,
                             java.lang.Throwable failure,
                             java.lang.String... headerNameValuePairs)
        Asserts a JSON error.
        Parameters:
        httpStatus - Expected HttpStatus.
        failure - Cause.
        headerNameValuePairs - Expected HttpHeader name/value pairs.