Set callbackConnectors = client.getCallbackConnectors(callbackHandler);
assertEquals(1, callbackConnectors.size());
Connector callbackConnector = (Connector) callbackConnectors.iterator().next();
Field field = BisocketServerInvoker.class.getDeclaredField("controlMonitorTimerTask");
field.setAccessible(true);
BisocketServerInvoker serverInvoker = (BisocketServerInvoker) callbackConnector.getServerInvoker();
TimerTask timerTask = (TimerTask) field.get(serverInvoker);
assertNotNull(timerTask);
log.info("ControlMonitorTimerTask was created");
// Verify PingTimerTask is created.
field = ServerInvoker.class.getDeclaredField("callbackHandlers");
field.setAccessible(true);
BisocketServerInvoker callbackServerInvoker = (BisocketServerInvoker) connector.getServerInvoker();
Map callbackHandlers = (Map) field.get(callbackServerInvoker);
assertEquals(1, callbackHandlers.size());
Object o = callbackHandlers.values().iterator().next();
Client callbackClient = ((ServerInvokerCallbackHandler) o).getCallbackClient();
BisocketClientInvoker clientInvoker = (BisocketClientInvoker) callbackClient.getInvoker();