@Test
public void testCorrectFrameOrder() {

  MonoProcessor<Object> delayer = MonoProcessor.create();
  BaseSubscriber<Payload> subscriber =
      new BaseSubscriber<Payload>() {
        @Override
        protected void hookOnSubscribe(Subscription subscription) {}
      };
  rule.socket
      .requestChannel(
          Flux.concat(Flux.just(0).delayUntil(i -> delayer), Flux.range(1, 999))
              .map(i -> DefaultPayload.create(i + "")))
      .subscribe(subscriber);
  subscriber.request(1);
  subscriber.request(Long.MAX_VALUE);
  delayer.onComplete();
  Iterator<ByteBuf> iterator = rule.connection.getSent().iterator();
  ByteBuf initialFrame = iterator.next();
  Assertions.assertThat(FrameHeaderCodec.frameType(initialFrame)).isEqualTo(REQUEST_CHANNEL);
  Assertions.assertThat(RequestChannelFrameCodec.initialRequestN(initialFrame))
      .isEqualTo(Long.MAX_VALUE);
  Assertions.assertThat(RequestChannelFrameCodec.data(initialFrame).toString(CharsetUtil.UTF_8))
      .isEqualTo("0");
  Assertions.assertThat(initialFrame.release()).isTrue();
  Assertions.assertThat(iterator.hasNext()).isFalse();
  rule.assertHasNoLeaks();
}