move subscribeToBus in configureGameListener function, and use it on test
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user