WSEndpoint { @OnError public void onError(Session session, Throwable t) { getWSController().onError(session, t); }  @OnOpen void handleOpenConnexion(Session session, EndpointConfig config); @OnError void onError(Session session, Throwable t); @OnClose void handleClosedConnexion(Session session, CloseReason closeReason); @OnMessage void receiveCommandMessage(Session client, String json);  }
@Test public void testOnError() { System.out.println("onError"); Session session = mock(Session.class); Throwable t = mock(Throwable.class); WSController wSController = mock(WSController.class); doReturn(wSController).when(instance).getWSController(); instance.onError(session, t); verify(wSController).onError(eq(session), eq(t)); }