Rename listeners

This commit is contained in:
2025-03-11 21:49:29 +01:00
parent c84aa7e0c1
commit a2756d7fdb
8 changed files with 18 additions and 18 deletions

View File

@@ -4,8 +4,8 @@ import eventDemo.app.command.command.GameCommand
import eventDemo.app.command.command.IWantToJoinTheGameCommand
import eventDemo.app.entity.GameId
import eventDemo.app.entity.Player
import eventDemo.app.eventListener.GameEventPlayerNotificationListener
import eventDemo.app.eventListener.GameEventReactionListener
import eventDemo.app.eventListener.PlayerNotificationEventListener
import eventDemo.app.eventListener.ReactionEventListener
import eventDemo.app.notification.Notification
import eventDemo.app.notification.WelcomeToTheGameNotification
import eventDemo.configuration.appKoinModule
@@ -22,12 +22,12 @@ class GameCommandHandlerTest :
test("handle a command should execute the command") {
koinApplication { modules(appKoinModule) }.koin.apply {
val commandHandler by inject<GameCommandHandler>()
val notificationListener by inject<GameEventPlayerNotificationListener>()
val notificationListener by inject<PlayerNotificationEventListener>()
val gameId = GameId()
val player = Player("Tesla")
val channelCommand = Channel<GameCommand>(Channel.BUFFERED)
val channelNotification = Channel<Notification>(Channel.BUFFERED)
GameEventReactionListener(get(), get(), get()).init()
ReactionEventListener(get(), get(), get()).init()
notificationListener.startListening(channelNotification, player)
GlobalScope.launch {

View File

@@ -12,8 +12,8 @@ import eventDemo.app.event.GameEventStream
import eventDemo.app.event.event.disableShuffleDeck
import eventDemo.app.event.projection.GameState
import eventDemo.app.event.projection.buildStateFromEventStream
import eventDemo.app.eventListener.GameEventPlayerNotificationListener
import eventDemo.app.eventListener.GameEventReactionListener
import eventDemo.app.eventListener.PlayerNotificationEventListener
import eventDemo.app.eventListener.ReactionEventListener
import eventDemo.app.notification.ItsTheTurnOfNotification
import eventDemo.app.notification.Notification
import eventDemo.app.notification.PlayerAsJoinTheGameNotification
@@ -131,8 +131,8 @@ class GameStateTest :
koinApplication { modules(appKoinModule) }.koin.apply {
val commandHandler by inject<GameCommandHandler>()
val eventStream by inject<GameEventStream>()
val playerNotificationListener by inject<GameEventPlayerNotificationListener>()
GameEventReactionListener(get(), get(), get()).init()
val playerNotificationListener by inject<PlayerNotificationEventListener>()
ReactionEventListener(get(), get(), get()).init()
playerNotificationListener.startListening(channelNotification1, player1)
playerNotificationListener.startListening(channelNotification2, player2)