Class HttpRequest.Builder
- java.lang.Object
-
- io.contract_testing.contractcase.definitions.matchers.http.HttpRequest.Builder
-
- All Implemented Interfaces:
software.amazon.jsii.Builder<HttpRequest>
- Enclosing class:
- HttpRequest
@Stability(Stable) public static final class HttpRequest.Builder extends Object implements software.amazon.jsii.Builder<HttpRequest>
A fluent builder forHttpRequest.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description HttpRequest.Builderbody(Object body)A test equivalence matcher or json object that describes the body for this response.HttpRequestbuild()static HttpRequest.Buildercreate()HttpRequest.Builderheaders(Object headers)A Map of header names and associated test-equivalence matcher values accepted by this example.HttpRequest.Buildermethod(Object method)A string or string matcher that matches the method used for this example (eg"GET"or"POST").HttpRequest.Builderpath(Object path)A string or string matcher that matches the path of this example.HttpRequest.Builderquery(Object query)A test-equivalence matcher for the query.HttpRequest.BuilderuniqueName(String uniqueName)What unique name, if any, to give to this request.
-
-
-
Method Detail
-
create
@Stability(Stable) public static HttpRequest.Builder create()
- Returns:
- a new instance of
HttpRequest.Builder.
-
method
@Stability(Stable) public HttpRequest.Builder method(Object method)
A string or string matcher that matches the method used for this example (eg"GET"or"POST").Case insensitive. Note that DELETE, GET and HEAD requests should not have bodies - see the HTTP RFCs for details.
- Parameters:
method- A string or string matcher that matches the method used for this example (eg"GET"or"POST"). This parameter is required.- Returns:
this
-
path
@Stability(Stable) public HttpRequest.Builder path(Object path)
A string or string matcher that matches the path of this example.Note that any query parameters must be in the query, not in the path.
- Parameters:
path- A string or string matcher that matches the path of this example. This parameter is required.- Returns:
this
-
body
@Stability(Stable) public HttpRequest.Builder body(Object body)
A test equivalence matcher or json object that describes the body for this response.If not provided, no body matching is performed.
- Parameters:
body- A test equivalence matcher or json object that describes the body for this response. This parameter is required.- Returns:
this
-
headers
@Stability(Stable) public HttpRequest.Builder headers(Object headers)
A Map of header names and associated test-equivalence matcher values accepted by this example.If not provided, no header matching is performed
- Parameters:
headers- A Map of header names and associated test-equivalence matcher values accepted by this example. This parameter is required.- Returns:
this
-
query
@Stability(Stable) public HttpRequest.Builder query(Object query)
A test-equivalence matcher for the query.Usually this is a Map of test-equivalence matchers to match the parsed query string, keyed by parameter name. Repeated parameters are collated and put in an array in this map.
- Parameters:
query- A test-equivalence matcher for the query. This parameter is required.- Returns:
this
-
uniqueName
@Stability(Stable) public HttpRequest.Builder uniqueName(String uniqueName)
What unique name, if any, to give to this request.- Parameters:
uniqueName- What unique name, if any, to give to this request. This parameter is required.- Returns:
this
-
build
@Stability(Stable) public HttpRequest build()
- Specified by:
buildin interfacesoftware.amazon.jsii.Builder<HttpRequest>- Returns:
- a newly built instance of
HttpRequest.
-
-