@Test public void addMessage() throws Exception { final SockJsService service = mock(SockJsService.class); final SockJsSession sockJSSession = new SockJsSession("123", service); sockJSSession.addMessage("hello"); assertThat(sockJSSession.getAllMessages().size(), is(1)); }
public void addMessage(final String message) { messageQueue.add(message); updateTimestamp(); }
SockJsSession { public void addMessage(final String message) { messageQueue.add(message); updateTimestamp(); } }
SockJsSession { public void addMessage(final String message) { messageQueue.add(message); updateTimestamp(); } SockJsSession(final String sessionId, final SockJsService service); }
SockJsSession { public void addMessage(final String message) { messageQueue.add(message); 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 addMessage(final String message) { messageQueue.add(message); 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();  }