RedisClient implements Client { @Override public byte[] expire(final byte[] key) throws ConnectionException, IOException { transaction.open(); try { final byte[] value = get(key); commandExecutor.execute(RedisCommands.EXPIRE, key, new byte[]{'0'}); commandResult.getInt(); return value; } finally { transaction.close(); } } RedisClient(final RedisCommandExecutor redisCommandExecutor,
      final RedisCommandResult redisCommandResult);  RedisClient(final Connection connection);  RedisClient();  RedisClient(final String host);  RedisClient(final String host, final int port); @Override void ping(); @Override void set(final byte[] key, final byte[] value); @Override void set(final byte[] key, final byte[] value, final long expiryInMillis); byte[] longToBytes(final long longToBeConverted); @Override byte[] get(final byte[] key); @Override byte[] expire(final byte[] key); @Override void flushdb(); @Override int dbsize();  }
@Test public void expire() throws ConnectionException, IOException { byte[] key = {'1'}; byte[] value = {'1'}; doReturn(value).when(commandResult).getBytes(); doReturn(1).when(commandResult).getInt(); byte[] actualValue = redisClient.expire(key); verify(commandExecutor).execute(RedisCommands.GET, key); verify(commandExecutor).execute(RedisCommands.EXPIRE, key, new byte[]{'0'}); assertEquals(value, actualValue); }