Class MockWoofServer.MockWoofResponseImpl

    • Method Detail

      • getJson

        public <T> T getJson​(int statusCode,
                             java.lang.Class<T> clazz)
        Description copied from interface: MockWoofResponse
        Obtains the JSON object from HTTP payload.
        Specified by:
        getJson in interface MockWoofResponse
        Type Parameters:
        T - Type of object.
        Parameters:
        statusCode - HttpStatus.
        clazz - Class for the JSON object.
        Returns:
        JSON object.
      • getJson

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

        public void assertJson​(int statusCode,
                               java.lang.Object entity,
                               java.lang.String... headerNameValuePairs)
        Description copied from interface: MockWoofResponse
        Asserts the JSON response.
        Specified by:
        assertJson in interface MockWoofResponse
        Parameters:
        statusCode - HttpStatus.
        entity - Object to be written as JSON.
        headerNameValuePairs - Expected HttpHeader name/value pairs.
      • assertJson

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

        public void assertJsonError​(java.lang.Throwable failure,
                                    java.lang.String... headerNameValuePairs)
        Description copied from interface: MockWoofResponse
        Asserts a JSON error.
        Specified by:
        assertJsonError in interface MockWoofResponse
        Parameters:
        failure - Cause.
        headerNameValuePairs - Expected HttpHeader name/value pairs.
      • assertJsonError

        public void assertJsonError​(int httpStatus,
                                    java.lang.Throwable failure,
                                    java.lang.String... headerNameValuePairs)
        Description copied from interface: MockWoofResponse
        Asserts a JSON error.
        Specified by:
        assertJsonError in interface MockWoofResponse
        Parameters:
        httpStatus - Expected HttpStatus.
        failure - Cause.
        headerNameValuePairs - Expected HttpHeader name/value pairs.