Skip to content

Commit d556acd

Browse files
committedDec 3, 2024··
Added test for invalidate all
1 parent a86cbda commit d556acd

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed
 

‎aedile-core/src/test/kotlin/com/sksamuel/aedile/core/AsCacheTest.kt

+11
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,17 @@ class AsCacheTest : FunSpec() {
9393
cache.getIfPresent("wibble") shouldBe null
9494
}
9595

96+
test("should support invalidateAll") {
97+
val cache = Caffeine.newBuilder().asCache<String, String>()
98+
cache.put("wibble", "wobble")
99+
cache.put("bibble", "bobble")
100+
cache.getIfPresent("wibble") shouldBe "wobble"
101+
cache.getIfPresent("bibble") shouldBe "bobble"
102+
cache.invalidateAll()
103+
cache.getIfPresent("wibble") shouldBe null
104+
cache.getIfPresent("bibble") shouldBe null
105+
}
106+
96107
test("should support contains") {
97108
val cache = Caffeine.newBuilder().asCache<String, String>()
98109
cache.put("wibble", "wobble")

0 commit comments

Comments
 (0)
Please sign in to comment.