@Test public void onOpen() throws Exception { final SockJsService service = mock(SockJsService.class); final SockJsSession sockJSSession = new SockJsSession("123", service); final SockJsSessionContext session = mock(SockJsSessionContext.class); sockJSSession.onOpen(session); verify(service).onOpen(session); assertThat(sockJSSession.getState(), is(State.OPEN)); }
public void onOpen(final SockJsSessionContext session) { setState(State.OPEN); service.onOpen(session); updateTimestamp(); }
SockJsSession { public void onOpen(final SockJsSessionContext session) { setState(State.OPEN); service.onOpen(session); updateTimestamp(); } }
SockJsSession { public void onOpen(final SockJsSessionContext session) { setState(State.OPEN); service.onOpen(session); updateTimestamp(); } SockJsSession(final String sessionId, final SockJsService service); }
SockJsSession { public void onOpen(final SockJsSessionContext session) { setState(State.OPEN); service.onOpen(session); updateTimestamp(); } SockJsSession(final String sessionId, final SockJsService service); ChannelHandlerContext connectionContext(); void setConnectionContext(final ChannelHandlerContext ctx); ChannelHandlerContext openContext(); void setOpenContext(final ChannelHandlerContext ctx); void setState(State newState); State getState(); boolean inuse(); void setInuse(final boolean use); SockJsConfig config(); String sessionId(); void onMessage(final String message); void onOpen(final SockJsSessionContext session); void onClose(); void addMessage(final String message); List<String> getAllMessages(); @SuppressWarnings("ManualArrayToCollectionCopy") void addMessages(final String[] messages); long timestamp(); @Override String toString(); }
SockJsSession { public void onOpen(final SockJsSessionContext session) { setState(State.OPEN); service.onOpen(session); updateTimestamp(); } SockJsSession(final String sessionId, final SockJsService service); ChannelHandlerContext connectionContext(); void setConnectionContext(final ChannelHandlerContext ctx); ChannelHandlerContext openContext(); void setOpenContext(final ChannelHandlerContext ctx); void setState(State newState); State getState(); boolean inuse(); void setInuse(final boolean use); SockJsConfig config(); String sessionId(); void onMessage(final String message); void onOpen(final SockJsSessionContext session); void onClose(); void addMessage(final String message); List<String> getAllMessages(); @SuppressWarnings("ManualArrayToCollectionCopy") void addMessages(final String[] messages); long timestamp(); @Override String toString();  }