Package net.jadler
Interface JadlerConfiguration
-
- All Known Implementing Classes:
Jadler.OngoingConfiguration
public interface JadlerConfigurationAn interface for classes capable of providing defaults for the Jadler configuration.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description JadlerConfigurationwithDefaultResponseContentType(String defaultContentType)Defines a default content type of every stub http response.JadlerConfigurationwithDefaultResponseEncoding(Charset defaultEncoding)Defines a default encoding of every stub http response.JadlerConfigurationwithDefaultResponseHeader(String name, String value)Defines a response header that will be sent in every http stub response.JadlerConfigurationwithDefaultResponseStatus(int defaultStatus)Sets the default http response status.JadlerConfigurationwithRequestsRecordingDisabled()Disables incoming http requests recording.
-
-
-
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 (seeResponseStubbing.withContentType(java.lang.String)).- Parameters:
defaultContentType- defaultContent-Typeheader of every http stub response- Returns:
- this ongoing configuration
-
withDefaultResponseEncoding
JadlerConfiguration withDefaultResponseEncoding(Charset defaultEncoding)
Defines a default encoding of every stub http response. This value will be used for all stub responses with no specific encoding defined (seeResponseStubbing.withEncoding(java.nio.charset.Charset)).- Parameters:
defaultEncoding- default stub response encoding- 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 headervalue- 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. (seeResponseStubbing.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)
-
-