RedisTest.java 561 B

1234567891011121314151617
  1. package com.izouma.nineth;
  2. import org.junit.Test;
  3. import org.springframework.beans.factory.annotation.Autowired;
  4. import org.springframework.data.redis.core.BoundValueOperations;
  5. import org.springframework.data.redis.core.RedisTemplate;
  6. public class RedisTest extends ApplicationTests {
  7. @Autowired
  8. private RedisTemplate<String, Object> redisTemplate;
  9. @Test
  10. public void testINC() {
  11. redisTemplate.opsForValue().increment("collectionNumber::2");
  12. System.out.println(redisTemplate.opsForValue().get("collectionNumber::2"));
  13. }
  14. }