CustomMatcher Class
- java.
lang. Object - com.
azure. core. test. models. TestProxyRequestMatcher - com.
azure. core. test. models. CustomMatcher
- com.
- com.
public class CustomMatcher
extends TestProxyRequestMatcher
This matcher exposes the default matcher in a customizable way. Currently, this includes ignoring/excluding headers, comparing request bodies and ignoring query params or query params ordering.
Constructor Summary
Constructor | Description |
---|---|
CustomMatcher() |
Creates an instance of Custom |
Method Summary
Modifier and Type | Method and Description |
---|---|
List<String> |
getExcludedHeaders()
Gets the list of headers that should be excluded during matching. |
List<String> |
getHeadersKeyOnlyMatch()
Gets the list of headers that should be ignored during matching. |
List<String> |
getIgnoredQueryParameters()
Gets the list of query parameters that should be ignored during matching. |
boolean |
isComparingBodies()
Get the comparing bodies boolean. |
boolean |
isQueryOrderingIgnored()
Get the boolean value to sort query params alphabetically before comparing URIs when matching |
Custom |
setComparingBodies(boolean comparingBodies)
Sets true to enable body matching (default behavior), or false to disable body matching. |
Custom |
setExcludedHeaders(List<String> excludedHeaders)
Sets the list of headers that should be excluded during matching. |
Custom |
setHeadersKeyOnlyMatch(List<String> headersKeyOnlyMatch)
Sets the list of headers that should be ignored during matching. |
Custom |
setIgnoredQueryParameters(List<String> ignoredQueryParameters)
Sets the list of query parameters that should be ignored during matching. |
Custom |
setQueryOrderingIgnored(boolean queryOrderingIgnored)
Sets query ordering to a boolean value to sort query params alphabetically before comparing URIs when matching. |
Methods inherited from TestProxyRequestMatcher
Methods inherited from java.lang.Object
Constructor Details
CustomMatcher
public CustomMatcher()
Creates an instance of CustomMatcher
Method Details
getExcludedHeaders
public List
Gets the list of headers that should be excluded during matching. The presence of these headers will not be taken into account while matching.
Returns:
getHeadersKeyOnlyMatch
public List
Gets the list of headers that should be ignored during matching. The header values won't be matched, but the presence of these headers will be taken into account while matching.
Returns:
getIgnoredQueryParameters
public List
Gets the list of query parameters that should be ignored during matching. The parameter values won't be matched, but the presence of these parameters will be taken into account.
Returns:
isComparingBodies
public boolean isComparingBodies()
Get the comparing bodies boolean. True to enable body matching (default behavior), or false to disable body matching.
Returns:
isQueryOrderingIgnored
public boolean isQueryOrderingIgnored()
Get the boolean value to sort query params alphabetically before comparing URIs when matching
Returns:
setComparingBodies
public CustomMatcher setComparingBodies(boolean comparingBodies)
Sets true to enable body matching (default behavior), or false to disable body matching.
Parameters:
Returns:
setExcludedHeaders
public CustomMatcher setExcludedHeaders(List
Sets the list of headers that should be excluded during matching. The presence of these headers will not be taken into account while matching.
Parameters:
Returns:
setHeadersKeyOnlyMatch
public CustomMatcher setHeadersKeyOnlyMatch(List
Sets the list of headers that should be ignored during matching. The header values won't be matched, but the presence of these headers will be taken into account while matching.
Parameters:
Returns:
setIgnoredQueryParameters
public CustomMatcher setIgnoredQueryParameters(List
Sets the list of query parameters that should be ignored during matching. The parameter values won't be matched, but the presence of these parameters will be taken into account.
Parameters:
Returns:
setQueryOrderingIgnored
public CustomMatcher setQueryOrderingIgnored(boolean queryOrderingIgnored)
Sets query ordering to a boolean value to sort query params alphabetically before comparing URIs when matching.
Parameters:
Returns:
Applies to
Azure SDK for Java