public final class ClientDriverRequest extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
ClientDriverRequest.Method
Class that represents an HTTP method.
|
| Constructor and Description |
|---|
ClientDriverRequest(org.hamcrest.Matcher<? extends String> path)
Constructor taking String matcher.
|
ClientDriverRequest(Pattern path)
Constructor taking Pattern.
|
ClientDriverRequest(String path)
Constructor taking String.
|
| Modifier and Type | Method and Description |
|---|---|
ClientDriverRequest |
capturingBodyIn(BodyCapture<?> bodyCapture)
Setter for adding a
BodyCapture to the expectation for later assertions/debugging. |
BodyCapture<?> |
getBodyCapture() |
org.hamcrest.Matcher<? extends String> |
getBodyContentMatcher() |
org.hamcrest.Matcher<? extends String> |
getBodyContentType() |
Set<String> |
getExcludedHeaders() |
Map<String,org.hamcrest.Matcher<? extends String>> |
getHeaders() |
ClientDriverRequest.Method |
getMethod() |
org.hamcrest.Matcher<? extends String> |
getPath()
Get the path.
|
String |
toString()
toString.
|
ClientDriverRequest |
withAnyParams()
Setter for expecting any number of querystring parameters with any values.
|
ClientDriverRequest |
withBasicAuth(String username,
String password) |
ClientDriverRequest |
withBody(org.hamcrest.Matcher<? extends String> bodyContentMatcher,
String contentType)
Setter for expecting body content and type, where content is in the form of a Matcher and type is in the form of
a Pattern.
|
ClientDriverRequest |
withBody(Pattern withBodyContent,
Pattern contentType)
Setter for expecting body content and type, where content is in the form of a Pattern and type is in the form of
a Pattern.
|
ClientDriverRequest |
withBody(Pattern withBodyContent,
String contentType)
Setter for expecting body content and type, where content is in the form of a Pattern and type is in the form of
a String.
|
ClientDriverRequest |
withBody(String withBodyContent,
Pattern contentType)
Setter for expecting body content and type, where content is in the form of a String and type is in the form of a
Pattern.
|
ClientDriverRequest |
withBody(String withBodyContent,
String withContentType)
Setter for expecting body content and type, where content is in the form of a String and type is in the form of a
String.
|
ClientDriverRequest |
withHeader(String withHeaderName,
org.hamcrest.Matcher<? extends String> headerValueMatcher)
Setter for expecting a specific header name and value matcher.
|
ClientDriverRequest |
withHeader(String withHeaderName,
Pattern withHeaderValue)
Setter for expecting a specific header name and value pair, where value is in the form of a Pattern.
|
ClientDriverRequest |
withHeader(String withHeaderName,
String withHeaderValue)
Setter for expecting a specific header name and value pair.
|
ClientDriverRequest |
withHeaders(Map<String,Object> headers)
Setter for expecting a map of header name and value pairs.
|
ClientDriverRequest |
withMethod(ClientDriverRequest.Method withMethod) |
ClientDriverRequest |
withoutHeader(String withoutHeaderName)
Setter for expecting a specific header name not to be present on the request.
|
ClientDriverRequest |
withParam(String key,
boolean value)
Setter for expecting query-string parameters on the end of the url.
|
ClientDriverRequest |
withParam(String key,
int value)
Setter for expecting query-string parameters on the end of the url.
|
ClientDriverRequest |
withParam(String key,
long value)
Setter for expecting query-string parameters on the end of the url.
|
ClientDriverRequest |
withParam(String key,
org.hamcrest.Matcher<? extends String> value)
Setter for expecting query-string parameters on the end of the url.
|
ClientDriverRequest |
withParam(String key,
Object value)
Setter for expecting query-string parameters on the end of the url.
|
ClientDriverRequest |
withParam(String key,
Pattern value)
Setter for expecting query-string parameters on the end of the url.
|
ClientDriverRequest |
withParam(String key,
String value)
Setter for expecting query-string parameters on the end of the url.
|
ClientDriverRequest |
withParams(Map<String,Object> newParams)
Setter for expecting multiple query-string parameters on the end of the url.
|
public ClientDriverRequest(org.hamcrest.Matcher<? extends String> path)
path - The mandatory argument is the path which will be listened onpublic ClientDriverRequest(String path)
path - The mandatory argument is the path which will be listened onpublic ClientDriverRequest(Pattern path)
path - The mandatory argument is the path which will be listened onpublic org.hamcrest.Matcher<? extends String> getPath()
public ClientDriverRequest withMethod(ClientDriverRequest.Method withMethod)
withMethod - the method to setpublic ClientDriverRequest.Method getMethod()
public ClientDriverRequest withAnyParams()
public ClientDriverRequest withParam(String key, String value)
key - The key from ?key=valuevalue - The value from ?key=value in the form of a Stringpublic ClientDriverRequest withParam(String key, int value)
key - The key from ?key=valuevalue - The value from ?key=value in the form of a Stringpublic ClientDriverRequest withParam(String key, long value)
key - The key from ?key=valuevalue - The value from ?key=value in the form of a Stringpublic ClientDriverRequest withParam(String key, boolean value)
key - The key from ?key=valuevalue - The value from ?key=value in the form of a Stringpublic ClientDriverRequest withParam(String key, Object value)
key - The key from ?key=valuevalue - The value from ?key=value in the form of a Stringpublic ClientDriverRequest withParam(String key, Pattern value)
key - The key from ?key=valuevalue - The value from ?key=value in the form of a Patternpublic ClientDriverRequest withParam(String key, org.hamcrest.Matcher<? extends String> value)
key - The key from ?key=valuevalue - The value from ?key=value in the form of a Matcherpublic ClientDriverRequest withParams(Map<String,Object> newParams)
newParams - The map of key value pairs from ?key=valuepublic String toString()
public org.hamcrest.Matcher<? extends String> getBodyContentMatcher()
public org.hamcrest.Matcher<? extends String> getBodyContentType()
public ClientDriverRequest withBody(String withBodyContent, String withContentType)
withBodyContent - the bodyContent to setwithContentType - eg "text/plain"public ClientDriverRequest withBody(String withBodyContent, Pattern contentType)
withBodyContent - the bodyContent to setcontentType - eg "text/plain"public ClientDriverRequest withBody(Pattern withBodyContent, String contentType)
withBodyContent - the bodyContent to setcontentType - eg "text/plain"public ClientDriverRequest withBody(Pattern withBodyContent, Pattern contentType)
withBodyContent - the bodyContent to setcontentType - eg "text/plain"public ClientDriverRequest withBody(org.hamcrest.Matcher<? extends String> bodyContentMatcher, String contentType)
bodyContentMatcher - the Matcher<String> to use to setcontentType - eg "text/plain"public ClientDriverRequest capturingBodyIn(BodyCapture<?> bodyCapture)
BodyCapture to the expectation for later assertions/debugging.bodyCapture - the capturing object.public BodyCapture<?> getBodyCapture()
public ClientDriverRequest withHeader(String withHeaderName, org.hamcrest.Matcher<? extends String> headerValueMatcher)
withHeaderName - the headerName to match onheaderValueMatcher - the matcher to use for the header valuepublic ClientDriverRequest withHeader(String withHeaderName, String withHeaderValue)
withHeaderName - the headerName to match onwithHeaderValue - the headerValue to match onpublic ClientDriverRequest withoutHeader(String withoutHeaderName)
withoutHeaderName - the headerName to match onpublic ClientDriverRequest withHeader(String withHeaderName, Pattern withHeaderValue)
withHeaderName - the headerName to match onwithHeaderValue - the headerValue to match onpublic ClientDriverRequest withHeaders(Map<String,Object> headers)
headers - a map of header names to header values to match onpublic ClientDriverRequest withBasicAuth(String username, String password)
public Map<String,org.hamcrest.Matcher<? extends String>> getHeaders()
Copyright © 2016. All Rights Reserved.