@Test public void call_close() { CloseEvent event = mock(CloseEvent.class); when(event.getSession()).thenReturn(session); caller.visit(event); verify(event).getSession(); verify(session).getService(); verify(service).getIoHandler(); verify(handler).sessionClosed(session); verifyNoMoreInteractions(session, event, handler); }
@Override public void visit(CloseEvent event) { IoSession session = event.getSession(); try { session.getService().getIoHandler().sessionClosed(session); } catch (Exception e) { session.getService().getIoHandler().exceptionCaught(session, e); } }
HandlerCaller implements EventVisitor { @Override public void visit(CloseEvent event) { IoSession session = event.getSession(); try { session.getService().getIoHandler().sessionClosed(session); } catch (Exception e) { session.getService().getIoHandler().exceptionCaught(session, e); } } }
HandlerCaller implements EventVisitor { @Override public void visit(CloseEvent event) { IoSession session = event.getSession(); try { session.getService().getIoHandler().sessionClosed(session); } catch (Exception e) { session.getService().getIoHandler().exceptionCaught(session, e); } }  }
HandlerCaller implements EventVisitor { @Override public void visit(CloseEvent event) { IoSession session = event.getSession(); try { session.getService().getIoHandler().sessionClosed(session); } catch (Exception e) { session.getService().getIoHandler().exceptionCaught(session, e); } }  @Override void visit(CloseEvent event); @Override void visit(IdleEvent event); @Override void visit(OpenEvent event); @Override void visit(ReceiveEvent event); @Override void visit(SentEvent event); @Override void visit(HandshakeStartedEvent event); @Override void visit(HandshakeCompletedEvent event); @Override void visit(SecureClosedEvent event); }
HandlerCaller implements EventVisitor { @Override public void visit(CloseEvent event) { IoSession session = event.getSession(); try { session.getService().getIoHandler().sessionClosed(session); } catch (Exception e) { session.getService().getIoHandler().exceptionCaught(session, e); } }  @Override void visit(CloseEvent event); @Override void visit(IdleEvent event); @Override void visit(OpenEvent event); @Override void visit(ReceiveEvent event); @Override void visit(SentEvent event); @Override void visit(HandshakeStartedEvent event); @Override void visit(HandshakeCompletedEvent event); @Override void visit(SecureClosedEvent event);  }