@@ -616,7 +616,15 @@ private static Stream<Arguments> racingCases() {
616
616
}),
617
617
Arguments .of (
618
618
(Function <ClientSocketRule , Publisher <Payload >>)
619
- (rule ) -> rule .socket .requestResponse (EmptyPayload .INSTANCE ),
619
+ (rule ) -> {
620
+ ByteBuf data = rule .allocator .buffer ();
621
+ data .writeCharSequence ("testData" , CharsetUtil .UTF_8 );
622
+
623
+ ByteBuf metadata = rule .allocator .buffer ();
624
+ metadata .writeCharSequence ("testMetadata" , CharsetUtil .UTF_8 );
625
+ Payload requestPayload = ByteBufPayload .create (data , metadata );
626
+ return rule .socket .requestResponse (requestPayload );
627
+ },
620
628
(BiConsumer <AssertSubscriber <Payload >, ClientSocketRule >)
621
629
(as , rule ) -> {
622
630
ByteBufAllocator allocator = rule .alloc ();
@@ -630,6 +638,32 @@ private static Stream<Arguments> racingCases() {
630
638
PayloadFrameCodec .encode (
631
639
allocator , streamId , false , false , true , metadata , data );
632
640
641
+ RaceTestUtils .race (as ::cancel , () -> rule .connection .addToReceivedBuffer (frame ));
642
+ }),
643
+ Arguments .of (
644
+ (Function <ClientSocketRule , Publisher <Payload >>)
645
+ (rule ) -> {
646
+ ByteBuf data = rule .allocator .buffer ();
647
+ data .writeCharSequence ("testData" , CharsetUtil .UTF_8 );
648
+
649
+ ByteBuf metadata = rule .allocator .buffer ();
650
+ metadata .writeCharSequence ("testMetadata" , CharsetUtil .UTF_8 );
651
+ Payload requestPayload = ByteBufPayload .create (data , metadata );
652
+ return rule .socket .requestStream (requestPayload );
653
+ },
654
+ (BiConsumer <AssertSubscriber <Payload >, ClientSocketRule >)
655
+ (as , rule ) -> {
656
+ ByteBufAllocator allocator = rule .alloc ();
657
+ ByteBuf metadata = allocator .buffer ();
658
+ metadata .writeCharSequence ("abc" , CharsetUtil .UTF_8 );
659
+ ByteBuf data = allocator .buffer ();
660
+ data .writeCharSequence ("def" , CharsetUtil .UTF_8 );
661
+ as .request (Long .MAX_VALUE );
662
+ int streamId = rule .getStreamIdForRequestType (REQUEST_STREAM );
663
+ ByteBuf frame =
664
+ PayloadFrameCodec .encode (
665
+ allocator , streamId , false , true , true , metadata , data );
666
+
633
667
RaceTestUtils .race (as ::cancel , () -> rule .connection .addToReceivedBuffer (frame ));
634
668
}));
635
669
}
0 commit comments