@Test
public void keepAlives() throws Exception {

  underTest.connect();
  RemoteEndpoint.Basic basicRemote = mock(RemoteEndpoint.Basic.class);
  doReturn(basicRemote).when(session).getBasicRemote();
  doReturn(true).when(session).isOpen();
  Awaitility.await().atMost(2, SECONDS).pollInterval(200, MILLISECONDS).until(() -> {
    try {
      verify(basicRemote).sendPong(any());
    } catch (Exception e) {
      fail();
    }
  });
}