Skip to content

Commit b481266

Browse files
atakavcisazzad16
andauthored
Apply suggestions from code review
drop and/or replace maxsize where we can Co-authored-by: M Sazzadul Hoque <[email protected]>
1 parent 74a4185 commit b481266

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

Diff for: src/test/java/redis/clients/jedis/csc/ClientSideCacheFunctionalityTest.java

+6-7
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public void flushAllTest() {
4343
control.set("k" + i, "v" + i);
4444
}
4545

46-
try (JedisPooled jedis = new JedisPooled(hnp, clientConfig.get(), CacheConfig.builder().maxSize(1000).build())) {
46+
try (JedisPooled jedis = new JedisPooled(hnp, clientConfig.get(), CacheConfig.builder().build())) {
4747
Cache cache = jedis.getCache();
4848
for (int i = 0; i < count; i++) {
4949
jedis.get("k" + i);
@@ -92,7 +92,7 @@ public void lruEvictionTest() {
9292

9393
@Test // T.5.2
9494
public void deleteByKeyUsingMGetTest() {
95-
try (JedisPooled jedis = new JedisPooled(hnp, clientConfig.get(), CacheConfig.builder().maxSize(1000).build())) {
95+
try (JedisPooled jedis = new JedisPooled(hnp, clientConfig.get(), CacheConfig.builder().build())) {
9696
Cache clientSideCache = jedis.getCache();
9797

9898
jedis.set("1", "one");
@@ -243,8 +243,7 @@ public void maximumSizeExact() {
243243
public void testInvalidationWithUnifiedJedis() {
244244
Cache cache = new TestCache();
245245
Cache mock = Mockito.spy(cache);
246-
UnifiedJedis client = new UnifiedJedis(hnp, clientConfig.get(), mock) {
247-
};
246+
UnifiedJedis client = new UnifiedJedis(hnp, clientConfig.get(), mock);
248247
UnifiedJedis controlClient = new UnifiedJedis(hnp, clientConfig.get());
249248

250249
try {
@@ -272,7 +271,7 @@ public void testInvalidationWithUnifiedJedis() {
272271
public void differentInstanceOnEachCacheHit() {
273272

274273
// fill the cache for maxSize
275-
try (JedisPooled jedis = new JedisPooled(hnp, clientConfig.get(), CacheConfig.builder().maxSize(1000).build())) {
274+
try (JedisPooled jedis = new JedisPooled(hnp, clientConfig.get(), CacheConfig.builder().build())) {
276275
Cache cache = jedis.getCache();
277276
jedis.sadd("foo", "a");
278277
jedis.sadd("foo", "b");
@@ -348,7 +347,7 @@ public void testConcurrentAccessWithStats() throws InterruptedException {
348347
ExecutorService executorService = Executors.newFixedThreadPool(threadCount);
349348

350349
// Create the shared mock instance of cache
351-
try (JedisPooled jedis = new JedisPooled(endpoint.getHostAndPort(), clientConfig.get(), CacheConfig.builder().maxSize(1000).build())) {
350+
try (JedisPooled jedis = new JedisPooled(endpoint.getHostAndPort(), clientConfig.get(), CacheConfig.builder().build())) {
352351
Cache cache = jedis.getCache();
353352
// Submit multiple threads to perform concurrent operations
354353
CountDownLatch latch = new CountDownLatch(threadCount);
@@ -385,7 +384,7 @@ public void testMaxSize() throws InterruptedException {
385384

386385
ExecutorService executorService = Executors.newFixedThreadPool(threadCount);
387386

388-
try (JedisPooled jedis = new JedisPooled(endpoint.getHostAndPort(), clientConfig.get(), CacheConfig.builder().maxSize(1000).build())) {
387+
try (JedisPooled jedis = new JedisPooled(endpoint.getHostAndPort(), clientConfig.get(), CacheConfig.builder().maxSize(maxSize).build())) {
389388
Cache testCache = jedis.getCache();
390389
// Submit multiple threads to perform concurrent operations
391390
CountDownLatch latch = new CountDownLatch(threadCount);

0 commit comments

Comments
 (0)