Package io.wcm.caravan.testing.http
Class RequestMatcher
- java.lang.Object
-
- io.wcm.caravan.testing.http.RequestMatcher
-
@ProviderType public final class RequestMatcher extends Object
Defines which requests should match. Only one service and one url matcher can be defined.
-
-
Constructor Summary
Constructors Constructor Description RequestMatcher()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
response(io.wcm.caravan.io.http.response.CaravanHttpResponse payload)
Set the response that this request matcher should return.void
response(String payload)
Set the response that this request matcher should return.RequestMatcher
serviceId(String value)
RequestMatcher
serviceName(String value)
Deprecated.Please useserviceId(String)
RequestMatcher
url(String value)
RequestMatcher
urlMatches(Pattern pattern)
RequestMatcher
urlMatches(org.hamcrest.Matcher<String> value)
RequestMatcher
urlStartsWith(String value)
-
-
-
Method Detail
-
serviceId
public RequestMatcher serviceId(String value)
- Parameters:
value
- Service ID- Returns:
- this
-
serviceName
@Deprecated public RequestMatcher serviceName(String value)
Deprecated.Please useserviceId(String)
- Parameters:
value
- Service ID- Returns:
- this
-
url
public RequestMatcher url(String value)
- Parameters:
value
- Exact URL- Returns:
- this
-
urlStartsWith
public RequestMatcher urlStartsWith(String value)
- Parameters:
value
- Starting part of URL- Returns:
- this
-
urlMatches
public RequestMatcher urlMatches(org.hamcrest.Matcher<String> value)
- Parameters:
value
- Matcher for URL- Returns:
- this
-
urlMatches
public RequestMatcher urlMatches(Pattern pattern)
- Parameters:
pattern
- Regex pattern to mathc URL- Returns:
- this
-
response
public void response(String payload)
Set the response that this request matcher should return.- Parameters:
payload
- Payload
-
response
public void response(io.wcm.caravan.io.http.response.CaravanHttpResponse payload)
Set the response that this request matcher should return.- Parameters:
payload
- Payload
-
-