Testing and ecosystem paths
Latest stable Based on Bluetape4k release 1.11.0
Lock contracts without an external server
Section titled “Lock contracts without an external server”The cache-core tests use local providers, mocked delegates, and in-memory fixtures.
./gradlew :bluetape4k-cache-core:test --no-build-cache --no-configuration-cacheAdd four tests to adoption code first:
- Repeated calls for one key do not rerun the evaluator.
- Concurrent same-key misses merge when the chosen contract promises it.
- The next call recomputes after failure or cancellation.
- The system recovers within the accepted stale window when invalidation fails after a source write.
Published fixtures
Section titled “Published fixtures”The module publishes AbstractSuspendJCacheTest, blocking and suspend Near Cache fixtures, and memoizer fixtures. Provider implementations can inherit them to cover clearLocal, clearAll, conditional replacement, statistics, and close as well as CRUD.
class MyNearCacheTest : AbstractNearCacheOperationsTest<String>() { override fun createCache(): NearCacheOperations<String> = myNearCache() override fun sampleValue(): String = "hello" override fun anotherValue(): String = "world"}Remote-provider tests use real servers. Keep them separate from cache-core unit tests and run Testcontainers sequentially.
Lettuce and Redisson
Section titled “Lettuce and Redisson”bluetape4k-cache-lettuce covers Redis hash JCache, Lettuce Near Cache, and RESP3 CLIENT TRACKING. Verify local-entry lifetime when invalidation disconnects.
bluetape4k-cache-redisson continues with Redisson JCache and RLocalCachedMap. Its provider tests cover Pub/Sub invalidation, reconnection, and local-cache options.
Both implement cache-core contracts, but wire protocols, event delivery, and recovery behavior differ.
Continue to JDBC and Exposed
Section titled “Continue to JDBC and Exposed”Cache-core getOrPut and Near Cache put do not own persistence. Learn connection and transaction boundaries in bluetape4k-jdbc, then continue to bluetape4k-exposed.
The cache chapter in exposed-workshop shows the complete repository boundary:
JdbcCacheRepositoryowns database and cache calls;EntityMapLoaderloads a miss from the database;EntityMapWriterprovides persistence write-through or write-behind;RMapandRLocalCachedMapprovide remote and local cache tiers.
This is where a cache writer actually reaches an Exposed database and table.
Workshop sequence
Section titled “Workshop sequence”- Run cache-core tests for local cache and memoizer concurrency.
- Verify invalidation through the selected Redis provider manual and tests.
- Compare cache-aside, read-through, and write-through in exposed-workshop.
- Add expiry and failure metrics to a bluetape4k-workshop service example.
Do not claim a speedup without benchmark evidence. Measure hit rate, throughput, latency, and source-store load for the real workload.