WSEndpoint { @OnMessage public void receiveCommandMessage(Session client, String json) { getWSController().receiveCommandMessage(client, json); }  @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 testReceiveCommandMessage() { System.out.println("receiveCommandMessage"); Session session = mock(Session.class); WSController wSController = mock(WSController.class); doReturn(wSController).when(instance).getWSController(); instance.receiveCommandMessage(session, "JSON"); verify(wSController).receiveCommandMessage(eq(session), eq("JSON")); }