### Question:
WebSocketClient extends org.java_websocket.client.WebSocketClient { @Override public void onError(Exception e) { log.error(String.format("WebSocket connection to {} failed with error", uri), e); listener.onError(e); } WebSocketClient(URI serverUri);  WebSocketClient(URI serverUri, Map<String,String> httpHeaders); @Override void onOpen(ServerHandshake serverHandshake); @Override void onMessage(String s); @Override void onClose(int code, String reason, boolean remote); @Override void onError(Exception e); void setListener(WebSocketListener listener);  }### Answer:
@Test public void testNotifyListenerOnError() throws Exception { IOException e = new IOException("123"); client.onError(e); verify(listener).onError(e); }