@Test
@Timeout(2_000)
public void testHandleValidFrame() {

  Publisher<Payload> response = rule.socket.requestResponse(EmptyPayload.INSTANCE);
  Subscriber<Payload> sub = TestSubscriber.create();
  response.subscribe(sub);
  int streamId = rule.getStreamIdForRequestType(REQUEST_RESPONSE);
  rule.connection.addToReceivedBuffer(
      PayloadFrameCodec.encodeNextReleasingPayload(
          rule.alloc(), streamId, EmptyPayload.INSTANCE));
  verify(sub).onComplete();
  Assertions.assertThat(rule.connection.getSent()).hasSize(1).allMatch(ReferenceCounted::release);
  rule.assertHasNoLeaks();
}