java.lang.Object
io.helidon.webserver.testsupport.TestRequest
An API to compose a test request.
-
Method Summary
Modifier and TypeMethodDescriptioncall(io.helidon.common.http.Http.RequestMethod method) Calls using specified HTTP method with body.call(io.helidon.common.http.Http.RequestMethod method, MediaPublisher mediaPublisher) Calls using specified HTTP method with body.delete()Calls HTTP DELETE method with body.delete(MediaPublisher mediaPublisher) Calls HTTP DELETE method with body.get()Calls HTTP GET method with body.get(MediaPublisher mediaPublisher) Calls HTTP GET method with body.head()Calls HTTP HEAD method with body.head(MediaPublisher mediaPublisher) Calls HTTP HEAD method with body.Add a header.options()Calls HTTP OPTIONS method with body.options(MediaPublisher mediaPublisher) Calls HTTP OPTIONS method with body.post()Calls HTTP POST method with body.post(MediaPublisher mediaPublisher) Calls HTTP POST method with body.put()Calls HTTP PUT method with body.put(MediaPublisher mediaPublisher) Calls HTTP PUT method with body.queryParameter(String name, String value) Add a query parameter.trace()Calls HTTP TRACE method with body.trace(MediaPublisher mediaPublisher) Calls HTTP TRACE method with body.version(io.helidon.common.http.Http.Version version) Define an HTTP version.
-
Method Details
-
queryParameter
Add a query parameter.- Parameters:
name- a name.value- a value.- Returns:
- Updated instance.
- Throws:
NullPointerException- Ifnameorvalueparameter isnull.
-
header
Add a header.- Parameters:
name- a name.value- a value.- Returns:
- Updated instance.
- Throws:
NullPointerException- Ifnameorvalueparameter isnull.
-
version
Define an HTTP version. Default isHTTP/1.1.- Parameters:
version- a version to set.- Returns:
- Updated instance.
- Throws:
NullPointerException- Ifnameorvalueparameter isnull.
-
get
public TestResponse get(MediaPublisher mediaPublisher) throws InterruptedException, TimeoutException Calls HTTP GET method with body.- Parameters:
mediaPublisher- a request body publisher.- Returns:
- a response to read.
- Throws:
InterruptedException- if thread is interrupted.TimeoutException- if request timeout is reached.
-
get
Calls HTTP GET method with body.- Returns:
- a response to read.
- Throws:
InterruptedException- if thread is interrupted.TimeoutException- if request timeout is reached.
-
post
public TestResponse post(MediaPublisher mediaPublisher) throws InterruptedException, TimeoutException Calls HTTP POST method with body.- Parameters:
mediaPublisher- a request body publisher.- Returns:
- a response to read.
- Throws:
InterruptedException- if thread is interrupted.TimeoutException- if request timeout is reached.
-
post
Calls HTTP POST method with body.- Returns:
- a response to read.
- Throws:
InterruptedException- if thread is interrupted.TimeoutException- if request timeout is reached.
-
put
public TestResponse put(MediaPublisher mediaPublisher) throws InterruptedException, TimeoutException Calls HTTP PUT method with body.- Parameters:
mediaPublisher- a request body publisher.- Returns:
- a response to read.
- Throws:
InterruptedException- if thread is interrupted.TimeoutException- if request timeout is reached.
-
put
Calls HTTP PUT method with body.- Returns:
- a response to read.
- Throws:
InterruptedException- if thread is interrupted.TimeoutException- if request timeout is reached.
-
delete
public TestResponse delete(MediaPublisher mediaPublisher) throws InterruptedException, TimeoutException Calls HTTP DELETE method with body.- Parameters:
mediaPublisher- a request body publisher.- Returns:
- a response to read.
- Throws:
InterruptedException- if thread is interrupted.TimeoutException- if request timeout is reached.
-
delete
Calls HTTP DELETE method with body.- Returns:
- a response to read.
- Throws:
InterruptedException- if thread is interrupted.TimeoutException- if request timeout is reached.
-
options
public TestResponse options(MediaPublisher mediaPublisher) throws InterruptedException, TimeoutException Calls HTTP OPTIONS method with body.- Parameters:
mediaPublisher- a request body publisher.- Returns:
- a response to read.
- Throws:
InterruptedException- if thread is interrupted.TimeoutException- if request timeout is reached.
-
options
Calls HTTP OPTIONS method with body.- Returns:
- a response to read.
- Throws:
InterruptedException- if thread is interrupted.TimeoutException- if request timeout is reached.
-
head
public TestResponse head(MediaPublisher mediaPublisher) throws InterruptedException, TimeoutException Calls HTTP HEAD method with body.- Parameters:
mediaPublisher- a request body publisher.- Returns:
- a response to read.
- Throws:
InterruptedException- if thread is interrupted.TimeoutException- if request timeout is reached.
-
head
Calls HTTP HEAD method with body.- Returns:
- a response to read.
- Throws:
InterruptedException- if thread is interrupted.TimeoutException- if request timeout is reached.
-
trace
public TestResponse trace(MediaPublisher mediaPublisher) throws InterruptedException, TimeoutException Calls HTTP TRACE method with body.- Parameters:
mediaPublisher- a request body publisher.- Returns:
- a response to read.
- Throws:
InterruptedException- if thread is interrupted.TimeoutException- if request timeout is reached.
-
trace
Calls HTTP TRACE method with body.- Returns:
- a response to read.
- Throws:
InterruptedException- if thread is interrupted.TimeoutException- if request timeout is reached.
-
call
public TestResponse call(io.helidon.common.http.Http.RequestMethod method, MediaPublisher mediaPublisher) throws InterruptedException, TimeoutException Calls using specified HTTP method with body.- Parameters:
method- an HTTP method.mediaPublisher- a request body publisher.- Returns:
- a response to read.
- Throws:
InterruptedException- if thread is interrupted.TimeoutException- if request timeout is reached.
-
call
public TestResponse call(io.helidon.common.http.Http.RequestMethod method) throws InterruptedException, TimeoutException Calls using specified HTTP method with body.- Parameters:
method- an HTTP method.- Returns:
- a response to read.
- Throws:
InterruptedException- if thread is interrupted.TimeoutException- if request timeout is reached.
-