Skip to content

Commit 154f74c

Browse files
committed
DATAREDIS-563 - Migrate ticket references in test code to Spring Framework style.
1 parent 2b93ca3 commit 154f74c

File tree

113 files changed

+1713
-6306
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

113 files changed

+1713
-6306
lines changed

src/test/java/org/springframework/data/redis/cache/RedisCacheManagerTransactionalUnitTests.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2015-2016 the original author or authors.
2+
* Copyright 2015-2017 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -103,10 +103,7 @@ public RedisTemplate redisTemplate() {
103103
}
104104
}
105105

106-
/**
107-
* @see DATAREDIS-375
108-
*/
109-
@Test
106+
@Test // DATAREDIS-375
110107
public void testCacheIsNotDecoratedTwiceWithTransactionAwareCacheDecorator() {
111108

112109
Cache cache = cacheManager.getCache(cacheName);

src/test/java/org/springframework/data/redis/cache/RedisCacheManagerUnitTests.java

Lines changed: 9 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2014 the original author or authors.
2+
* Copyright 2014-2017 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -68,38 +68,26 @@ public void setUp() {
6868
cacheManager.afterPropertiesSet();
6969
}
7070

71-
/**
72-
* @see DATAREDIS-246
73-
*/
74-
@Test
71+
@Test // DATAREDIS-246
7572
public void testGetCacheReturnsNewCacheWhenRequestedCacheIsNotAvailable() {
7673

7774
Cache cache = cacheManager.getCache("not-available");
7875
assertThat(cache, notNullValue());
7976
}
8077

81-
/**
82-
* @see DATAREDIS-246
83-
*/
84-
@Test
78+
@Test // DATAREDIS-246
8579
public void testGetCacheReturnsExistingCacheWhenRequested() {
8680

8781
Cache cache = cacheManager.getCache("cache");
8882
assertThat(cacheManager.getCache("cache"), sameInstance(cache));
8983
}
9084

91-
/**
92-
* @see DATAREDIS-246
93-
*/
94-
@Test
85+
@Test // DATAREDIS-246
9586
public void testCacheInitSouldNotRequestRemoteKeysByDefault() {
9687
Mockito.verifyZeroInteractions(redisConnectionMock);
9788
}
9889

99-
/**
100-
* @see DATAREDIS-246
101-
*/
102-
@Test
90+
@Test // DATAREDIS-246
10391
public void testCacheInitShouldFetchAllCacheKeysWhenLoadingRemoteCachesOnStartupIsEnabled() {
10492

10593
cacheManager = new RedisCacheManager(redisTemplate);
@@ -111,11 +99,8 @@ public void testCacheInitShouldFetchAllCacheKeysWhenLoadingRemoteCachesOnStartup
11199
assertThat(redisTemplate.getKeySerializer().deserialize(captor.getValue()).toString(), is("*~keys"));
112100
}
113101

114-
/**
115-
* @see DATAREDIS-246
116-
*/
117102
@SuppressWarnings("unchecked")
118-
@Test
103+
@Test // DATAREDIS-246
119104
public void testCacheInitShouldInitializeRemoteCachesCorrectlyWhenLoadingRemoteCachesOnStartupIsEnabled() {
120105

121106
Set<byte[]> keys = new HashSet<byte[]>(Arrays.asList(redisTemplate.getKeySerializer()
@@ -129,10 +114,7 @@ public void testCacheInitShouldInitializeRemoteCachesCorrectlyWhenLoadingRemoteC
129114
assertThat(cacheManager.getCacheNames(), IsCollectionContaining.hasItem("remote-cache"));
130115
}
131116

132-
/**
133-
* @see DATAREDIS-246
134-
*/
135-
@Test
117+
@Test // DATAREDIS-246
136118
public void testCacheInitShouldNotInitialzeCachesWhenLoadingRemoteCachesOnStartupIsEnabledAndNoCachesAvailableOnRemoteServer() {
137119

138120
when(redisConnectionMock.keys(any(byte[].class))).thenReturn(Collections.<byte[]> emptySet());
@@ -184,10 +166,7 @@ public void testPuttingCacheManagerIntoStaticModeShouldNotRemoveAlreadyRegistere
184166
assertThat(cacheManager.getCache("redis"), notNullValue());
185167
}
186168

187-
/**
188-
* @see DATAREDIS-283
189-
*/
190-
@Test
169+
@Test // DATAREDIS-283
191170
public void testRetainConfiguredCachesAfterBeanInitialization() {
192171

193172
cacheManager = new RedisCacheManager(redisTemplate);
@@ -198,10 +177,7 @@ public void testRetainConfiguredCachesAfterBeanInitialization() {
198177
assertThat(cacheManager.getCache("data"), notNullValue());
199178
}
200179

201-
/**
202-
* @see DATAREDIS-283
203-
*/
204-
@Test
180+
@Test // DATAREDIS-283
205181
public void testRetainConfiguredCachesAfterBeanInitializationWithLoadingOfRemoteKeys() {
206182

207183
Set<byte[]> keys = new HashSet<byte[]>(Arrays.asList(redisTemplate.getKeySerializer()

src/test/java/org/springframework/data/redis/cache/RedisCacheTest.java

Lines changed: 13 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2011-2016 the original author or authors.
2+
* Copyright 2011-2017 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -228,10 +228,7 @@ public void run() {
228228
assertFalse(monitorStateException.get());
229229
}
230230

231-
/**
232-
* @see DATAREDIS-243
233-
*/
234-
@Test
231+
@Test // DATAREDIS-243
235232
public void testCacheGetShouldReturnCachedInstance() {
236233
assumeThat(cache, instanceOf(RedisCache.class));
237234

@@ -242,10 +239,7 @@ public void testCacheGetShouldReturnCachedInstance() {
242239
assertThat(value, isEqual(((RedisCache) cache).get(key, Object.class)));
243240
}
244241

245-
/**
246-
* @see DATAREDIS-243
247-
*/
248-
@Test
242+
@Test // DATAREDIS-243
249243
public void testCacheGetShouldRetunInstanceOfCorrectType() {
250244
assumeThat(cache, instanceOf(RedisCache.class));
251245

@@ -257,10 +251,7 @@ public void testCacheGetShouldRetunInstanceOfCorrectType() {
257251
assertThat(redisCache.get(key, value.getClass()), instanceOf(value.getClass()));
258252
}
259253

260-
/**
261-
* @see DATAREDIS-243
262-
*/
263-
@Test(expected = ClassCastException.class)
254+
@Test(expected = ClassCastException.class) // DATAREDIS-243
264255
public void testCacheGetShouldThrowExceptionOnInvalidType() {
265256
assumeThat(cache, instanceOf(RedisCache.class));
266257

@@ -273,10 +264,7 @@ public void testCacheGetShouldThrowExceptionOnInvalidType() {
273264
Cache retrievedObject = redisCache.get(key, Cache.class);
274265
}
275266

276-
/**
277-
* @see DATAREDIS-243
278-
*/
279-
@Test
267+
@Test // DATAREDIS-243
280268
public void testCacheGetShouldReturnNullIfNoCachedValueFound() {
281269
assumeThat(cache, instanceOf(RedisCache.class));
282270

@@ -290,11 +278,7 @@ public void testCacheGetShouldReturnNullIfNoCachedValueFound() {
290278
assertThat(redisCache.get(invalidKey, value.getClass()), nullValue());
291279
}
292280

293-
/**
294-
* @see DATAREDIS-344
295-
* @see DATAREDIS-416
296-
*/
297-
@Test
281+
@Test // DATAREDIS-344, DATAREDIS-416
298282
public void putIfAbsentShouldSetValueOnlyIfNotPresent() {
299283

300284
assumeThat(cache, instanceOf(RedisCache.class));
@@ -317,10 +301,7 @@ public void putIfAbsentShouldSetValueOnlyIfNotPresent() {
317301
assertThat(wrapper.get(), equalTo(value));
318302
}
319303

320-
/**
321-
* @see DATAREDIS-510
322-
*/
323-
@Test
304+
@Test // DATAREDIS-510
324305
public void cachePutWithNullShouldNotAddStuffToRedis() {
325306

326307
assumeThat(getAllowCacheNullValues(), is(false));
@@ -333,10 +314,7 @@ public void cachePutWithNullShouldNotAddStuffToRedis() {
333314
assertThat(cache.get(key), is(nullValue()));
334315
}
335316

336-
/**
337-
* @see DATAREDIS-510
338-
*/
339-
@Test
317+
@Test // DATAREDIS-510
340318
public void cachePutWithNullShouldRemoveKeyIfExists() {
341319

342320
assumeThat(getAllowCacheNullValues(), is(false));
@@ -353,11 +331,7 @@ public void cachePutWithNullShouldRemoveKeyIfExists() {
353331
assertThat(cache.get(key), is(nullValue()));
354332
}
355333

356-
/**
357-
* @see DATAREDIS-443
358-
* @see DATAREDIS-452
359-
*/
360-
@Test
334+
@Test // DATAREDIS-443, DATAREDIS-452
361335
public void testCacheGetSynchronized() throws Throwable {
362336

363337
assumeThat(cache, instanceOf(RedisCache.class));
@@ -366,10 +340,7 @@ public void testCacheGetSynchronized() throws Throwable {
366340
runOnce(new CacheGetWithValueLoaderIsThreadSafe((RedisCache) cache));
367341
}
368342

369-
/**
370-
* @see DATAREDIS-553
371-
*/
372-
@Test
343+
@Test // DATAREDIS-553
373344
public void cachePutWithNullShouldAddStuffToRedisWhenCachingNullIsEnabled() {
374345

375346
assumeThat(getAllowCacheNullValues(), is(true));
@@ -382,10 +353,7 @@ public void cachePutWithNullShouldAddStuffToRedisWhenCachingNullIsEnabled() {
382353
assertThat(cache.get(key, String.class), is(nullValue()));
383354
}
384355

385-
/**
386-
* @see DATAREDIS-553
387-
*/
388-
@Test
356+
@Test // DATAREDIS-553
389357
public void testCacheGetSynchronizedNullAllowingNull() {
390358

391359
assumeThat(getAllowCacheNullValues(), is(true));
@@ -403,10 +371,7 @@ public Object call() throws Exception {
403371
assertThat(cache.get(key).get(), is(nullValue()));
404372
}
405373

406-
/**
407-
* @see DATAREDIS-553
408-
*/
409-
@Test
374+
@Test // DATAREDIS-553
410375
public void testCacheGetSynchronizedNullNotAllowingNull() {
411376

412377
assumeThat(getAllowCacheNullValues(), is(false));
@@ -425,10 +390,7 @@ public Object call() throws Exception {
425390
assertThat(cache.get(key), is(nullValue()));
426391
}
427392

428-
/**
429-
* @see DATAREDIS-553
430-
*/
431-
@Test
393+
@Test // DATAREDIS-553
432394
public void testCacheGetSynchronizedNullWithStoredNull() {
433395

434396
assumeThat(getAllowCacheNullValues(), is(true));

0 commit comments

Comments
 (0)