disable redis

This commit is contained in:
2025-04-05 02:08:55 +02:00
parent aca655952e
commit 37eaf7c8e5
5 changed files with 9 additions and 17 deletions

View File

@@ -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<GameStateRepositoryInRedis>()
get<GameStateRepositoryInMemory>()
.subscribeToBus(get(), get())
get<GameListRepositoryInRedis>()
get<GameListRepositoryInMemory>()
.subscribeToBus(get(), get())
}

View File

@@ -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
}

View File

@@ -60,5 +60,4 @@ fun UnifiedJedis.cleanProjections() {
fun Koin.cleanDataTest() {
get<DataSource>().cleanEventSource()
get<UnifiedJedis>().cleanProjections()
}

View File

@@ -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"

View File

@@ -51,7 +51,6 @@ class ProjectionSnapshotRepositoryTest :
val projectionRepo =
listOf(
::getSnapshotRepoInMemoryTest,
::getSnapshotRepoInRedisTest,
)
val list =