Package dev.relism.flash.testing
Class FlashRequest
java.lang.Object
dev.relism.flash.testing.FlashRequest
A request being built against a
FlashTest server. The HTTP verb is terminal — it
sends the request and hands back a FlashResponse:
app.request()
.header("Authorization", "Bearer " + token)
.json("{\"name\":\"bob\"}")
.post("/api/users")
.expectStatus(201);
For a bodyless GET or DELETE, FlashTest.get(java.lang.String) and
FlashTest.delete(java.lang.String) skip the builder entirely.-
Method Summary
Modifier and TypeMethodDescriptionbody(byte[] bytes) Sets a raw request body.Sets a UTF-8 request body.Adds a header.Sets a UTF-8 body andcontent-type: application/json.Sends any method, including the ones Flash adds beyond RFC 9110 (PURGE,QUERY).with(Consumer<FlashRequest> customizer) Appliescustomizer— how an extension's test kit attaches a credential, for instance.
-
Method Details
-
header
Adds a header. Repeatable — a name may be sent more than once. -
with
Appliescustomizer— how an extension's test kit attaches a credential, for instance. -
body
Sets a UTF-8 request body. -
body
Sets a raw request body. -
json
Sets a UTF-8 body andcontent-type: application/json. -
get
-
post
-
put
-
patch
-
delete
-
head
-
options
-
send
Sends any method, including the ones Flash adds beyond RFC 9110 (PURGE,QUERY).
-