GeezerVison is showing github.com — Also test DATA on RESERVED_LOCAL streams in DefaultHttp2ConnectionDec… · netty/netty@cd8b3f5
File tree
Expand file treeCollapse file tree
Open diff view settings
codec-http2/src/test/java/io/netty/handler/codec/http2
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: codec-http2/src/test/java/io/netty/handler/codec/http2/DefaultHttp2ConnectionDecoderTest.java +12-2Lines changed: 12 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
|
48 | 48 | import static io.netty.handler.codec.http2.Http2PromisedRequestVerifier.ALWAYS_VERIFY; |
49 | 49 | import static io.netty.handler.codec.http2.Http2Stream.State.IDLE; |
50 | 50 | import static io.netty.handler.codec.http2.Http2Stream.State.OPEN; |
| 51 | +import static io.netty.handler.codec.http2.Http2Stream.State.RESERVED_LOCAL; |
51 | 52 | import static io.netty.handler.codec.http2.Http2Stream.State.RESERVED_REMOTE; |
52 | 53 | import static io.netty.util.CharsetUtil.UTF_8; |
53 | 54 |
|
@@ -403,8 +404,17 @@ public void execute() throws Throwable { |
403 | 404 | } |
404 | 405 |
|
405 | 406 | @Test |
406 | | - public void dataReadForReservedStreamShouldThrowConnectionError() throws Exception { |
407 | | - when(stream.state()).thenReturn(RESERVED_REMOTE); |
| 407 | + public void dataReadForReservedRemoteStreamShouldThrowConnectionError() throws Exception { |
| 408 | + dataReadForReservedStreamShouldThrowConnectionError(RESERVED_REMOTE); |
| 409 | + } |
| 410 | + |
| 411 | + @Test |
| 412 | + public void dataReadForReservedLocalStreamShouldThrowConnectionError() throws Exception { |
| 413 | + dataReadForReservedStreamShouldThrowConnectionError(RESERVED_LOCAL); |
| 414 | + } |
| 415 | + |
| 416 | + private void dataReadForReservedStreamShouldThrowConnectionError(Http2Stream.State state) throws Exception { |
| 417 | + when(stream.state()).thenReturn(state); |
408 | 418 | final ByteBuf data = dummyData(); |
409 | 419 | try { |
410 | 420 | Http2Exception ex = assertThrows(Http2Exception.class, new Executable() { |
|