Class Http2TestConnection
java.lang.Object
io.helidon.webserver.testing.junit5.http2.Http2TestConnection
- All Implemented Interfaces:
AutoCloseable
Http/2 low-level testing client connection.
-
Method Summary
Modifier and TypeMethodDescriptionassertGoAway
(Http2ErrorCode errorCode, String message, Duration timeout) Wait for the next frame and assert its frame type to be GO_AWAY.assertHeaders
(int streamId, Duration timeout) Wait for the next frame and assert its frame type to be HEADERS.assertNextFrame
(Http2FrameType frameType, Duration timeout) Wait for the next frame and assert its frame type.assertRstStream
(int streamId, Duration timeout) Wait for the next frame and assert its frame type to be RST_STREAM.assertSettings
(Duration timeout) Wait for the next frame and assert its frame type to be SETTINGS.assertWindowsUpdate
(int streamId, Duration timeout) Wait for the next frame and assert its frame type to be WINDOWS_UPDATE.awaitNextFrame
(Duration timeout) Await next frame, blocks until next frame arrive.Client uri used for connection, derived from Helidon test server.void
close()
request
(int streamId, Method method, String path, WritableHeaders<?> headers, BufferData payload) Send HTTP request with given stream id with single data frame created from supplied buffer data, dataframe has end of stream flag.sendSettings
(Http2Settings http2Settings) Send settings frame.writer()
Return connection writer for direct frame sending.
-
Method Details
-
sendSettings
Send settings frame.- Parameters:
http2Settings
- frame to send- Returns:
- this connection
-
writer
Return connection writer for direct frame sending.- Returns:
- connection writer
-
request
public Http2TestConnection request(int streamId, Method method, String path, WritableHeaders<?> headers, BufferData payload) Send HTTP request with given stream id with single data frame created from supplied buffer data, dataframe has end of stream flag.- Parameters:
streamId
- send request as given stream idmethod
- http methodpath
- context pathheaders
- http headerspayload
- payload data which has to fit in single frame- Returns:
- this connection
-
awaitNextFrame
Await next frame, blocks until next frame arrive.- Parameters:
timeout
- timeout for blocking- Returns:
- next frame in order of reading from socket
-
assertRstStream
Wait for the next frame and assert its frame type to be RST_STREAM.- Parameters:
streamId
- stream id asserted from retrieved RST_STREAM frame.timeout
- timeout for blocking- Returns:
- the frame
-
assertSettings
Wait for the next frame and assert its frame type to be SETTINGS.- Parameters:
timeout
- timeout for blocking- Returns:
- the frame
-
assertWindowsUpdate
Wait for the next frame and assert its frame type to be WINDOWS_UPDATE.- Parameters:
streamId
- stream id asserted from retrieved WINDOWS_UPDATE frame.timeout
- timeout for blocking- Returns:
- the frame
-
assertHeaders
Wait for the next frame and assert its frame type to be HEADERS.- Parameters:
streamId
- stream id asserted from retrieved HEADERS frame.timeout
- timeout for blocking- Returns:
- the frame
-
assertNextFrame
Wait for the next frame and assert its frame type.- Parameters:
frameType
- expected type of frametimeout
- timeout for blocking- Returns:
- the frame
-
assertGoAway
Wait for the next frame and assert its frame type to be GO_AWAY.- Parameters:
errorCode
- expected error codemessage
- expected go away messagetimeout
- timeout for blocking- Returns:
- the frame
-
close
public void close()- Specified by:
close
in interfaceAutoCloseable
-
clientUri
Client uri used for connection, derived from Helidon test server.- Returns:
- client uri
-