File tree Expand file tree Collapse file tree 1 file changed +2
-7
lines changed
modules/transport-netty4/src/test/java/org/elasticsearch/http/netty4 Expand file tree Collapse file tree 1 file changed +2
-7
lines changed Original file line number Diff line number Diff line change @@ -140,10 +140,7 @@ public void testIgnoreReadWhenValidating() {
140140 assertNull ("content should not pass yet, need explicit read" , channel .readInbound ());
141141
142142 channel .read ();
143- var lastContent = channel .readInbound ();
144- assertTrue (lastContent instanceof LastHttpContent );
145- ((LastHttpContent ) lastContent ).release ();
146-
143+ asInstanceOf (LastHttpContent .class , channel .readInbound ()).release ();
147144 }
148145
149146 public void testWithFlowControlAndAggregator () {
@@ -162,9 +159,7 @@ public void testWithFlowControlAndAggregator() {
162159 validationRequest .listener .onResponse (null );
163160 channel .runPendingTasks ();
164161
165- var fullReq = channel .readInbound ();
166- assertTrue (fullReq instanceof FullHttpRequest );
167- ((FullHttpRequest ) fullReq ).release ();
162+ asInstanceOf (FullHttpRequest .class , channel .readInbound ()).release ();
168163 }
169164
170165 record ValidationRequest (HttpRequest request , Channel channel , ActionListener <Void > listener ) {}
You can’t perform that action at this time.
0 commit comments