Skip to content

Commit d757006

Browse files
Formatting in tests
1 parent ca8b2be commit d757006

File tree

2 files changed

+32
-32
lines changed

2 files changed

+32
-32
lines changed

src/test/groovy/grails/plugin/cache/redis/GrailsRedisCacheManagerSpec.groovy

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,31 +7,31 @@ class GrailsRedisCacheManagerSpec extends Specification {
77

88
def 'it should default expiration to never expire for all created caches when creating a cache manager with a null ttl value.'() {
99
given:
10-
Long ttl = null
11-
RedisTemplate template = Mock(RedisTemplate)
12-
GrailsRedisCacheManager cacheManager = new GrailsRedisCacheManager(template)
10+
Long ttl = null
11+
RedisTemplate template = Mock(RedisTemplate)
12+
GrailsRedisCacheManager cacheManager = new GrailsRedisCacheManager(template)
1313

14-
when: cacheManager.setTimeToLive(ttl)
15-
16-
and: GrailsRedisCache cache = cacheManager.getCache('book')
14+
when:
15+
cacheManager.setTimeToLive(ttl)
16+
and:
17+
GrailsRedisCache cache = cacheManager.getCache('book')
1718

1819
then:
19-
20-
assert cache.ttl == GrailsRedisCache.NEVER_EXPIRE
20+
assert cache.ttl == GrailsRedisCache.NEVER_EXPIRE
2121
}
2222

2323
def 'it should set expiration on all caches with configured ttl when creating a cache manager.'() {
2424
given:
25-
Long ttl = 5
26-
RedisTemplate template = Mock(RedisTemplate)
27-
GrailsRedisCacheManager cacheManager = new GrailsRedisCacheManager(template)
25+
Long ttl = 5
26+
RedisTemplate template = Mock(RedisTemplate)
27+
GrailsRedisCacheManager cacheManager = new GrailsRedisCacheManager(template)
2828

29-
when: cacheManager.setTimeToLive(ttl)
30-
31-
and: GrailsRedisCache cache = cacheManager.getCache('book')
29+
when:
30+
cacheManager.setTimeToLive(ttl)
31+
and:
32+
GrailsRedisCache cache = cacheManager.getCache('book')
3233

3334
then:
34-
35-
assert cache.ttl == ttl
35+
assert cache.ttl == ttl
3636
}
3737
}

src/test/groovy/grails/plugin/cache/redis/GrailsRedisCacheSpec.groovy

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,32 +9,32 @@ class GrailsRedisCacheSpec extends Specification {
99

1010
def 'it should default expiration to never expire when creating a cache with a null ttl value.'() {
1111
given:
12-
RedisCachePrefix cachePrefix = new DefaultRedisCachePrefix()
13-
String cacheName = 'book'
14-
byte[] prefix = cachePrefix.prefix(cacheName)
15-
RedisTemplate template = Mock(RedisTemplate)
16-
Long ttl = null
12+
RedisCachePrefix cachePrefix = new DefaultRedisCachePrefix()
13+
String cacheName = 'book'
14+
byte[] prefix = cachePrefix.prefix(cacheName)
15+
RedisTemplate template = Mock(RedisTemplate)
16+
Long ttl = null
1717

18-
when: GrailsRedisCache cache = new GrailsRedisCache(cacheName, prefix, template, ttl)
18+
when:
19+
GrailsRedisCache cache = new GrailsRedisCache(cacheName, prefix, template, ttl)
1920

2021
then:
21-
22-
assert cache.ttl == GrailsRedisCache.NEVER_EXPIRE
22+
assert cache.ttl == GrailsRedisCache.NEVER_EXPIRE
2323
}
2424

2525
def 'it should set expiration with configured ttl when creating a cache.'() {
2626
given:
27-
RedisCachePrefix cachePrefix = new DefaultRedisCachePrefix()
28-
String cacheName = 'book'
29-
byte[] prefix = cachePrefix.prefix(cacheName)
30-
RedisTemplate template = Mock(RedisTemplate)
31-
Long ttl = 500
27+
RedisCachePrefix cachePrefix = new DefaultRedisCachePrefix()
28+
String cacheName = 'book'
29+
byte[] prefix = cachePrefix.prefix(cacheName)
30+
RedisTemplate template = Mock(RedisTemplate)
31+
Long ttl = 500
3232

33-
when: GrailsRedisCache cache = new GrailsRedisCache(cacheName, prefix, template, ttl)
33+
when:
34+
GrailsRedisCache cache = new GrailsRedisCache(cacheName, prefix, template, ttl)
3435

3536
then:
36-
37-
assert cache.ttl == ttl
37+
assert cache.ttl == ttl
3838
}
3939

4040

0 commit comments

Comments
 (0)