@Test public void testSendLogoutStatus() throws Exception { AuthServer server = mock(AuthServer.class); MessageInputStream mis = mock(MessageInputStream.class); MessageOutputStream mos = mock(MessageOutputStream.class); MessageIO messageIO = new MessageIO(mis, mos); ClientHandler clientHandler = new ClientHandler(server, messageIO); clientHandler.sendLogoutStatus(true); try { clientHandler.getMessageIO().writeAllMessages(); } catch (IOException e) { clientHandler.shutdown(); } verify(mos, times(1)).writeMessage(any()); }
public void sendLogoutStatus(boolean success) { Message logoutResponse = getMessageFactory().generateLogoutResponse(success); getMessageIO().queueOutgoingMessage(logoutResponse); }
ClientHandler extends Connection { public void sendLogoutStatus(boolean success) { Message logoutResponse = getMessageFactory().generateLogoutResponse(success); getMessageIO().queueOutgoingMessage(logoutResponse); } }
ClientHandler extends Connection { public void sendLogoutStatus(boolean success) { Message logoutResponse = getMessageFactory().generateLogoutResponse(success); getMessageIO().queueOutgoingMessage(logoutResponse); } ClientHandler(AuthServer s, MessageIO messageIO); }
ClientHandler extends Connection { public void sendLogoutStatus(boolean success) { Message logoutResponse = getMessageFactory().generateLogoutResponse(success); getMessageIO().queueOutgoingMessage(logoutResponse); } ClientHandler(AuthServer s, MessageIO messageIO); void setHandlerId(int id); void update(); @Override void shutdown(); ServerMessageFactory getMessageFactory(); AuthServer getServer(); void sendLogoutStatus(boolean success); long getLoggedInTime(); void setLoggedInTime(long loggedInTime); int getHandlerId(); User getUser(); void setUser(User user); }
ClientHandler extends Connection { public void sendLogoutStatus(boolean success) { Message logoutResponse = getMessageFactory().generateLogoutResponse(success); getMessageIO().queueOutgoingMessage(logoutResponse); } ClientHandler(AuthServer s, MessageIO messageIO); void setHandlerId(int id); void update(); @Override void shutdown(); ServerMessageFactory getMessageFactory(); AuthServer getServer(); void sendLogoutStatus(boolean success); long getLoggedInTime(); void setLoggedInTime(long loggedInTime); int getHandlerId(); User getUser(); void setUser(User user);  }