package edu.wust.darcy.base;

import java.util.concurrent.TimeUnit;

import org.junit.Assert;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.StringRedisTemplate;

public class RedisTest extends SpringBaseTest {
	
	@Autowired
	private StringRedisTemplate redisTemplate;
	
	@Test
	public void testRedis() {
		redisTemplate.opsForValue().set("name", "darcy");
		Assert.assertEquals("darcy", redisTemplate.opsForValue().get("name"));
		
		redisTemplate.opsForValue().set("a", "1", 1L, TimeUnit.DAYS);
		redisTemplate.opsForValue().increment("a", 1L);
	}

}
