Skip to content

Commit de20b2a

Browse files
committed
Missed one
1 parent 40c92a0 commit de20b2a

File tree

1 file changed

+11
-26
lines changed

1 file changed

+11
-26
lines changed

server/src/test/java/org/elasticsearch/transport/InboundDecoderTests.java

Lines changed: 11 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -56,32 +56,17 @@ public void testDecode() throws IOException {
5656
}
5757

5858
try (RecyclerBytesStreamOutput os = new RecyclerBytesStreamOutput(recycler)) {
59-
final BytesReference totalBytes;
60-
if (isRequest) {
61-
totalBytes = OutboundHandler.serialize(
62-
isRequest ? OutboundHandler.MessageDirection.REQUEST : OutboundHandler.MessageDirection.RESPONSE,
63-
action,
64-
requestId,
65-
false,
66-
TransportVersion.current(),
67-
null,
68-
new TestRequest(randomAlphaOfLength(100)),
69-
threadContext,
70-
os
71-
);
72-
} else {
73-
totalBytes = OutboundHandler.serialize(
74-
isRequest ? OutboundHandler.MessageDirection.REQUEST : OutboundHandler.MessageDirection.RESPONSE,
75-
action,
76-
requestId,
77-
false,
78-
TransportVersion.current(),
79-
null,
80-
new TestResponse(randomAlphaOfLength(100)),
81-
threadContext,
82-
os
83-
);
84-
}
59+
final BytesReference totalBytes = OutboundHandler.serialize(
60+
isRequest ? OutboundHandler.MessageDirection.REQUEST : OutboundHandler.MessageDirection.RESPONSE,
61+
action,
62+
requestId,
63+
false,
64+
TransportVersion.current(),
65+
null,
66+
isRequest ? new TestRequest(randomAlphaOfLength(100)) : new TestResponse(randomAlphaOfLength(100)),
67+
threadContext,
68+
os
69+
);
8570
int totalHeaderSize = TcpHeader.HEADER_SIZE + totalBytes.getInt(TcpHeader.VARIABLE_HEADER_SIZE_POSITION);
8671
final BytesReference messageBytes = totalBytes.slice(totalHeaderSize, totalBytes.length() - totalHeaderSize);
8772

0 commit comments

Comments
 (0)