@Override
    public void onError(Exception e) {
        log.error("WebSocket connection to {} failed with error", uri, e);
        listenerOpt.ifPresent(listener -> listener.onError(e));
    }
@Test
    public void testNotifyListenerOnError() throws Exception {
        IOException e = new IOException("123");
        client.onError(e);

        verify(listener).onError(e);
    }