### Question:
ConnectionCmdExecute implements ICmdExecute { @Override public IRedisReply execute(RedisCommand request) { String cmd =new String(request.getArgs().get(0)); switch (cmd.toUpperCase()) { case "AUTH": if (request.getArgs().size() < 2) { String errMsg = String.format(ERR_MSG, cmd); return new ErrorRedisReply(errMsg.getBytes()); } return auth(request); case "ECHO": if (request.getArgs().size() < 2) { String errMsg = String.format(ERR_MSG, cmd); return new ErrorRedisReply(errMsg.getBytes()); } return new StatusRedisReply(request.getArgs().get(1)); case "PING": return new StatusRedisReply(ProtoUtils.PONG); case "QUIT": return new BulkRedisReply(); case "SELECT": if (request.getArgs().size() < 2) { String errMsg = String.format(ERR_MSG, cmd); return new ErrorRedisReply(errMsg.getBytes()); } return new StatusRedisReply(ProtoUtils.OK); default: return new StatusRedisReply(ProtoUtils.PONG); } }  @Override IRedisReply execute(RedisCommand request);  }### Answer:
@Test public void execute() { RedisCommand command =createCmd("auth"); assertNotNull(command); IRedisReply reply= execute.execute(command); assertNotNull(reply); assertEquals(Type.ERROR,reply.getType()); command =createCmd("ECHO"); assertNotNull(command); reply= execute.execute(command); assertNotNull(reply); assertEquals(Type.ERROR,reply.getType()); command =createCmd("SELECT"); assertNotNull(command); reply= execute.execute(command); assertNotNull(reply); assertEquals(Type.ERROR,reply.getType()); command =createCmd("PING"); assertNotNull(command); reply= execute.execute(command); assertNotNull(reply); assertEquals(Type.STATUS,reply.getType()); command =createCmd("QUIT"); assertNotNull(command); reply= execute.execute(command); assertNotNull(reply); assertEquals(Type.BULK,reply.getType()); command =createCmd("SELECT 1"); assertNotNull(command); reply= execute.execute(command); assertNotNull(reply); assertEquals(Type.STATUS,reply.getType()); command =createCmd("auth 1"); assertNotNull(command); reply= execute.execute(command); assertNotNull(reply); assertEquals(Type.STATUS,reply.getType()); command =createCmd("ECHO 1"); assertNotNull(command); reply= execute.execute(command); assertNotNull(reply); assertEquals(Type.STATUS,reply.getType()); }