@@ -543,6 +543,23 @@ public void drain_onRead(Cache<Integer, Integer> cache, CacheContext context) {
543
543
assertThat (buffer .size (), is (0 ));
544
544
}
545
545
546
+ @ Test (dataProvider = "caches" )
547
+ @ CacheSpec (compute = Compute .SYNC , implementation = Implementation .Caffeine ,
548
+ population = Population .FULL , maximumSize = Maximum .FULL )
549
+ public void drain_onRead_absent (Cache <Integer , Integer > cache , CacheContext context ) {
550
+ BoundedLocalCache <Integer , Integer > localCache = asBoundedLocalCache (cache );
551
+ Buffer <Node <Integer , Integer >> buffer = localCache .readBuffer ;
552
+ localCache .get (context .firstKey ());
553
+ assertThat (buffer .size (), is (1 ));
554
+
555
+ assertThat (localCache .get (context .absentKey ()), is (nullValue ()));
556
+ assertThat (buffer .size (), is (1 ));
557
+
558
+ localCache .drainStatus = REQUIRED ;
559
+ assertThat (localCache .get (context .absentKey ()), is (nullValue ()));
560
+ assertThat (buffer .size (), is (0 ));
561
+ }
562
+
546
563
@ Test (dataProvider = "caches" )
547
564
@ CacheSpec (compute = Compute .SYNC , implementation = Implementation .Caffeine ,
548
565
population = Population .EMPTY , maximumSize = Maximum .FULL )
0 commit comments