@Test
public void messages() throws Exception {

  doReturn(1).when(options).getInitialRequestAmount();
  doReturn(1).when(options).getReplenishingRequestAmount();
  Disposable subscribe = Flux.from(underTest.messages()).subscribe();
  subscribe.dispose();
  InOrder inOrder = Mockito.inOrder(socket);
  inOrder.verify(socket).send(new Request(1));
  inOrder.verify(socket).send(new Cancel());
}