@@ -512,7 +512,7 @@ public void testNullValue() throws InterruptedException {
512
512
String nonExisting = "non-existing-key" ;
513
513
control .del (nonExisting );
514
514
515
- try (JedisPooled jedis = new JedisPooled (hnp , clientConfig .get (), new CacheConfig () .builder ().maxSize (MAX_SIZE ).build ())) {
515
+ try (JedisPooled jedis = new JedisPooled (hnp , clientConfig .get (), CacheConfig .builder ().maxSize (MAX_SIZE ).build ())) {
516
516
Cache cache = jedis .getCache ();
517
517
CacheStats stats = cache .getStats ();
518
518
@@ -539,16 +539,10 @@ public void testNullValue() throws InterruptedException {
539
539
}
540
540
}
541
541
542
- public static class CustomCache extends TestCache {
543
- public CustomCache (int maximumSize , EvictionPolicy evictionPolicy ) {
544
- super (maximumSize , evictionPolicy , DefaultCacheable .INSTANCE );
545
- }
546
- }
547
-
548
542
@ Test
549
543
public void testCacheFactory () throws InterruptedException {
550
544
// this checks the instantiation with parameters (int, EvictionPolicy, Cacheable)
551
- try (JedisPooled jedis = new JedisPooled (hnp , clientConfig .get (), new CacheConfig () .builder ().cacheClass (TestCache .class ).build ())) {
545
+ try (JedisPooled jedis = new JedisPooled (hnp , clientConfig .get (), CacheConfig .builder ().cacheClass (TestCache .class ).build ())) {
552
546
Cache cache = jedis .getCache ();
553
547
CacheStats stats = cache .getStats ();
554
548
@@ -562,7 +556,8 @@ public void testCacheFactory() throws InterruptedException {
562
556
}
563
557
564
558
// this checks the instantiation with parameters (int, EvictionPolicy)
565
- try (JedisPooled jedis = new JedisPooled (hnp , clientConfig .get (), new CacheConfig ().builder ().cacheClass (CustomCache .class ).build ())) {
559
+ try (JedisPooled jedis = new JedisPooled (hnp , clientConfig .get (),
560
+ CacheConfig .builder ().cacheClass (TestCache .class ).cacheable (null ).build ())) {
566
561
Cache cache = jedis .getCache ();
567
562
CacheStats stats = cache .getStats ();
568
563
@@ -575,5 +570,4 @@ public void testCacheFactory() throws InterruptedException {
575
570
assertEquals (1 , stats .getMissCount ());
576
571
}
577
572
}
578
-
579
573
}
0 commit comments