From 37eaf7c8e5c7e67efa1a48bccfe102745aca1a38 Mon Sep 17 00:00:00 2001 From: Fabrice Lecomte Date: Sat, 5 Apr 2025 02:08:55 +0200 Subject: [PATCH] disable redis --- .../business/ConfigureGameListener.kt | 8 ++++---- .../injection/ConfigureDIInfrastructure.kt | 14 ++++---------- src/test/kotlin/eventDemo/Helpers.kt | 1 - .../adapter/infrastructureLayer/RedisTest.kt | 2 +- .../projection/ProjectionSnapshotRepositoryTest.kt | 1 - 5 files changed, 9 insertions(+), 17 deletions(-) diff --git a/src/main/kotlin/eventDemo/configuration/business/ConfigureGameListener.kt b/src/main/kotlin/eventDemo/configuration/business/ConfigureGameListener.kt index f418544..6b2d5be 100644 --- a/src/main/kotlin/eventDemo/configuration/business/ConfigureGameListener.kt +++ b/src/main/kotlin/eventDemo/configuration/business/ConfigureGameListener.kt @@ -1,7 +1,7 @@ package eventDemo.configuration.business -import eventDemo.adapter.infrastructureLayer.event.projection.GameListRepositoryInRedis -import eventDemo.adapter.infrastructureLayer.event.projection.GameStateRepositoryInRedis +import eventDemo.adapter.infrastructureLayer.event.projection.GameListRepositoryInMemory +import eventDemo.adapter.infrastructureLayer.event.projection.GameStateRepositoryInMemory import eventDemo.business.event.projection.projectionListener.ReactionListener import org.koin.core.Koin @@ -9,9 +9,9 @@ fun Koin.configureGameListener() { ReactionListener(get()) .subscribeToBus(get()) - get() + get() .subscribeToBus(get(), get()) - get() + get() .subscribeToBus(get(), get()) } diff --git a/src/main/kotlin/eventDemo/configuration/injection/ConfigureDIInfrastructure.kt b/src/main/kotlin/eventDemo/configuration/injection/ConfigureDIInfrastructure.kt index 7ab9510..1b9de11 100644 --- a/src/main/kotlin/eventDemo/configuration/injection/ConfigureDIInfrastructure.kt +++ b/src/main/kotlin/eventDemo/configuration/injection/ConfigureDIInfrastructure.kt @@ -5,9 +5,9 @@ import com.zaxxer.hikari.HikariConfig import com.zaxxer.hikari.HikariDataSource import eventDemo.adapter.infrastructureLayer.event.GameEventBusInRabbinMQ import eventDemo.adapter.infrastructureLayer.event.GameEventStoreInPostgresql -import eventDemo.adapter.infrastructureLayer.event.projection.GameListRepositoryInRedis +import eventDemo.adapter.infrastructureLayer.event.projection.GameListRepositoryInMemory import eventDemo.adapter.infrastructureLayer.event.projection.GameProjectionBusInMemory -import eventDemo.adapter.infrastructureLayer.event.projection.GameStateRepositoryInRedis +import eventDemo.adapter.infrastructureLayer.event.projection.GameStateRepositoryInMemory import eventDemo.business.event.GameEventBus import eventDemo.business.event.GameEventStore import eventDemo.business.event.projection.GameProjectionBus @@ -17,15 +17,9 @@ import eventDemo.libs.event.projection.SnapshotConfig import org.koin.core.module.Module import org.koin.core.module.dsl.singleOf import org.koin.dsl.bind -import redis.clients.jedis.JedisPooled -import redis.clients.jedis.UnifiedJedis import javax.sql.DataSource fun Module.configureDIInfrastructure(config: Configuration) { - single { - JedisPooled(config.redisUrl) - } bind UnifiedJedis::class - single { HikariConfig() .apply { @@ -53,10 +47,10 @@ fun Module.configureDIInfrastructure(config: Configuration) { singleOf(::GameProjectionBusInMemory) bind GameProjectionBus::class single { - GameStateRepositoryInRedis(get(), get(), snapshotConfig = SnapshotConfig()) + GameStateRepositoryInMemory(get(), snapshotConfig = SnapshotConfig()) } bind GameStateRepository::class single { - GameListRepositoryInRedis(get(), get(), snapshotConfig = SnapshotConfig()) + GameListRepositoryInMemory(get(), snapshotConfig = SnapshotConfig()) } bind GameListRepository::class } diff --git a/src/test/kotlin/eventDemo/Helpers.kt b/src/test/kotlin/eventDemo/Helpers.kt index c5d8239..391b268 100644 --- a/src/test/kotlin/eventDemo/Helpers.kt +++ b/src/test/kotlin/eventDemo/Helpers.kt @@ -60,5 +60,4 @@ fun UnifiedJedis.cleanProjections() { fun Koin.cleanDataTest() { get().cleanEventSource() - get().cleanProjections() } diff --git a/src/test/kotlin/eventDemo/adapter/infrastructureLayer/RedisTest.kt b/src/test/kotlin/eventDemo/adapter/infrastructureLayer/RedisTest.kt index b4756ee..53bace6 100644 --- a/src/test/kotlin/eventDemo/adapter/infrastructureLayer/RedisTest.kt +++ b/src/test/kotlin/eventDemo/adapter/infrastructureLayer/RedisTest.kt @@ -11,7 +11,7 @@ class RedisTest : FunSpec({ tags(NamedTag("redis")) - test("test connection with jedis") { + xtest("test connection with jedis") { JedisPooled(redisUrl).also { it.set("test", "test") it.get("test") shouldBeEqual "test" diff --git a/src/test/kotlin/eventDemo/business/event/projection/ProjectionSnapshotRepositoryTest.kt b/src/test/kotlin/eventDemo/business/event/projection/ProjectionSnapshotRepositoryTest.kt index bbb84f6..e883c02 100644 --- a/src/test/kotlin/eventDemo/business/event/projection/ProjectionSnapshotRepositoryTest.kt +++ b/src/test/kotlin/eventDemo/business/event/projection/ProjectionSnapshotRepositoryTest.kt @@ -51,7 +51,6 @@ class ProjectionSnapshotRepositoryTest : val projectionRepo = listOf( ::getSnapshotRepoInMemoryTest, - ::getSnapshotRepoInRedisTest, ) val list =