move subscribeToBus in configureGameListener function, and use it on test

This commit is contained in:
2025-04-14 23:40:11 +02:00
parent d5d6a48df3
commit 2fb4c778fd
10 changed files with 104 additions and 37 deletions
@@ -1,10 +1,17 @@
package eventDemo.configuration.business
import eventDemo.adapter.infrastructureLayer.event.projection.GameListRepositoryInRedis
import eventDemo.adapter.infrastructureLayer.event.projection.GameStateRepositoryInRedis
import eventDemo.business.event.projection.projectionListener.ReactionListener
import io.ktor.server.application.Application
import org.koin.ktor.ext.get
import org.koin.core.Koin
fun Application.configureGameListener() {
ReactionListener(get(), get())
.init()
fun Koin.configureGameListener() {
ReactionListener(get())
.subscribeToBus(get())
get<GameStateRepositoryInRedis>()
.subscribeToBus(get(), get())
get<GameListRepositoryInRedis>()
.subscribeToBus(get(), get())
}
@@ -43,7 +43,7 @@ fun Module.configureDIInfrastructure(config: Configuration) {
singleOf(::GameProjectionBusInMemory) bind GameProjectionBus::class
single {
GameStateRepositoryInRedis(get(), get(), get(), get(), snapshotConfig = SnapshotConfig())
GameStateRepositoryInRedis(get(), get(), snapshotConfig = SnapshotConfig())
} bind GameStateRepository::class
single {