WSEndpoint { @OnClose public void handleClosedConnexion(Session session, CloseReason closeReason) { getWSController().handleClosedConnexion(session, closeReason); }  @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 testHandleClosedConnexion() { System.out.println("handleClosedConnexion"); Session session = mock(Session.class); CloseReason closeReason = mock(CloseReason.class); WSController wSController = mock(WSController.class); doReturn(wSController).when(instance).getWSController(); instance.handleClosedConnexion(session, closeReason); verify(wSController).handleClosedConnexion(eq(session), eq(closeReason)); }