List of usage examples for org.springframework.data.redis.support.atomic RedisAtomicLong RedisAtomicLong
private RedisAtomicLong(String redisCounter, RedisOperations<String, Long> template,
@Nullable Long initialValue)
From source file:com.miko.demo.mongo.service.RedisInitTest.java
@Test public void testAtomicCounters() { RedisAtomicLong counter = new RedisAtomicLong("miko-spring-mongo:counter-test", connectionFactory, 0); Long l = counter.incrementAndGet(); assertThat(l, is(greaterThan(0L)));/*from w ww . ja v a 2s .c o m*/ }
From source file:com.miko.demo.postgresql.service.RedisInitTest.java
@Test public void testAtomicCounters() { RedisAtomicLong counter = new RedisAtomicLong("miko-spring-postgresql:counter-test", connectionFactory, 0); Long l = counter.incrementAndGet(); assertThat(l, is(greaterThan(0L)));//w w w . j av a 2 s . co m }