Package net.jadler

Interface JadlerConfiguration

  • All Known Implementing Classes:
    Jadler.OngoingConfiguration

    public interface JadlerConfiguration
    An interface for classes capable of providing defaults for the Jadler configuration.
    • Method Detail

      • withDefaultResponseContentType

        JadlerConfiguration withDefaultResponseContentType​(String defaultContentType)
        Defines a default content type of every stub http response. This value will be used for all stub responses with no specific content type defined (see ResponseStubbing.withContentType(java.lang.String)).
        Parameters:
        defaultContentType - default Content-Type header of every http stub response
        Returns:
        this ongoing configuration
      • withDefaultResponseHeader

        JadlerConfiguration withDefaultResponseHeader​(String name,
                                                      String value)
        Defines a response header that will be sent in every http stub response. Can be called repeatedly to define more headers.
        Parameters:
        name - name of the header
        value - header value
        Returns:
        this ongoing configuration
      • withDefaultResponseStatus

        JadlerConfiguration withDefaultResponseStatus​(int defaultStatus)
        Sets the default http response status. This value will be used for all stub responses with no specific http status defined. (see ResponseStubbing.withStatus(int))
        Parameters:
        defaultStatus - default http response status
        Returns:
        this ongoing configuration
      • withRequestsRecordingDisabled

        JadlerConfiguration withRequestsRecordingDisabled()

        Disables incoming http requests recording.

        Jadler mocking (verification) capabilities are implemented by storing all incoming requests (including their bodies). This could cause troubles in some very specific testing scenarios, for further explanation jump straight to JadlerMocker.setRecordRequests(boolean).

        Please note this method should be used very rarely and definitely should not be treated as a default.

        Returns:
        this ongoing configuration
        See Also:
        JadlerMocker.setRecordRequests(boolean)