IWSDecorator implements IWSController { @Override public void handleClosedConnexion(Session session, CloseReason closeReason) { logger.debug("Decorate websocket, close connexion '{}'", session.getId()); sessionManager.unlinkWs(session.getId()); iwse.handleClosedConnexion(session, closeReason); }  @Override void handleOpenConnexion(Session session, EndpointConfig config); @Override void handleClosedConnexion(Session session, CloseReason closeReason);  }
@Test public void testHandleClosedConnexion() { System.out.println("handleClosedConnexion"); Session session = mock(Session.class); when(session.getId()).thenReturn("WSID"); CloseReason closeReason = mock(CloseReason.class); instance.handleClosedConnexion(session, closeReason); verify(sessionManager).unlinkWs(eq("WSID")); verify(iwse).handleClosedConnexion(eq(session), eq(closeReason)); }