chore: upgrade versions and rename folders

This commit is contained in:
2026-07-20 19:54:58 +02:00
parent 7fb488ab56
commit 78956ce84e
113 changed files with 471 additions and 470 deletions
+3 -3
View File
@@ -1,9 +1,9 @@
package eventDemo
import com.zaxxer.hikari.HikariDataSource
import eventDemo.business.entity.Card
import eventDemo.business.entity.Deck
import eventDemo.configuration.business.configureGameListener
import eventDemo.domain.entity.Card
import eventDemo.domain.entity.Deck
import eventDemo.configuration.domain.configureGameListener
import eventDemo.configuration.injection.appKoinModule
import eventDemo.configuration.ktor.configuration
import io.github.oshai.kotlinlogging.KotlinLogging
@@ -1,12 +1,10 @@
package eventDemo.adapter.infrastructureLayer
package eventDemo.adapter.infrastructure.event
import com.rabbitmq.client.ConnectionFactory
import eventDemo.adapter.infrastructureLayer.event.GameEventBusInMemory
import eventDemo.adapter.infrastructureLayer.event.GameEventBusInRabbinMQ
import eventDemo.business.entity.GameId
import eventDemo.business.entity.Player
import eventDemo.business.event.GameEventBus
import eventDemo.business.event.event.NewPlayerEvent
import eventDemo.domain.entity.GameId
import eventDemo.domain.entity.Player
import eventDemo.domain.event.GameEventBus
import eventDemo.domain.event.event.NewPlayerEvent
import eventDemo.testKoinApplicationWithConfig
import io.kotest.assertions.nondeterministic.eventually
import io.kotest.core.spec.style.FunSpec
@@ -15,6 +13,7 @@ import io.kotest.matchers.equals.shouldBeEqual
import io.mockk.mockk
import io.mockk.spyk
import io.mockk.verify
import java.util.function.Function
import kotlin.time.Duration.Companion.seconds
class GameEventBusInRabbitMQTest :
@@ -28,7 +27,7 @@ class GameEventBusInRabbitMQTest :
)
withData(busListToTest) { bus ->
val spy = spyk(mockk<() -> Unit>())
val spy = spyk<() -> Unit>()
val aggregateId = GameId()
val player1 = Player(name = "Tesla")
val player2 = Player(name = "Einstein")
@@ -1,6 +1,6 @@
package eventDemo.adapter.interfaceLayer.query
package eventDemo.adapter.presenter.query
import eventDemo.business.entity.Player
import eventDemo.domain.entity.Player
import eventDemo.configuration.ktor.makeJwt
import io.ktor.client.request.HttpRequestBuilder
import io.ktor.client.request.header
@@ -1,12 +1,12 @@
package eventDemo.adapter.interfaceLayer.query
package eventDemo.adapter.presenter.query
import eventDemo.business.entity.GameId
import eventDemo.business.entity.Player
import eventDemo.business.event.GameEventHandler
import eventDemo.business.event.event.GameStartedEvent
import eventDemo.business.event.event.NewPlayerEvent
import eventDemo.business.event.event.PlayerReadyEvent
import eventDemo.business.event.projection.GameList
import eventDemo.domain.entity.GameId
import eventDemo.domain.entity.Player
import eventDemo.domain.event.GameEventHandler
import eventDemo.domain.event.event.GameStartedEvent
import eventDemo.domain.event.event.NewPlayerEvent
import eventDemo.domain.event.event.PlayerReadyEvent
import eventDemo.domain.event.projection.GameList
import eventDemo.testApplicationWithConfig
import io.github.oshai.kotlinlogging.KotlinLogging
import io.kotest.assertions.nondeterministic.eventually
@@ -1,26 +1,26 @@
package eventDemo.adapter.interfaceLayer.query
package eventDemo.adapter.presenter.query
import eventDemo.Tag
import eventDemo.business.command.GameCommandHandler
import eventDemo.business.command.command.GameCommand
import eventDemo.business.command.command.IWantToJoinTheGameCommand
import eventDemo.business.command.command.IWantToPlayCardCommand
import eventDemo.business.command.command.IamReadyToPlayCommand
import eventDemo.business.entity.Card
import eventDemo.business.entity.GameId
import eventDemo.business.entity.Player
import eventDemo.business.event.event.disableShuffleDeck
import eventDemo.business.event.projection.GameState
import eventDemo.business.event.projection.GameStateRepository
import eventDemo.business.event.projection.projectionListener.PlayerNotificationListener
import eventDemo.business.notification.CommandSuccessNotification
import eventDemo.business.notification.ItsTheTurnOfNotification
import eventDemo.business.notification.Notification
import eventDemo.business.notification.PlayerAsJoinTheGameNotification
import eventDemo.business.notification.PlayerAsPlayACardNotification
import eventDemo.business.notification.PlayerWasReadyNotification
import eventDemo.business.notification.TheGameWasStartedNotification
import eventDemo.business.notification.WelcomeToTheGameNotification
import eventDemo.domain.command.GameCommandHandler
import eventDemo.domain.command.command.GameCommand
import eventDemo.domain.command.command.IWantToJoinTheGameCommand
import eventDemo.domain.command.command.IWantToPlayCardCommand
import eventDemo.domain.command.command.IamReadyToPlayCommand
import eventDemo.domain.entity.Card
import eventDemo.domain.entity.GameId
import eventDemo.domain.entity.Player
import eventDemo.domain.event.event.disableShuffleDeck
import eventDemo.domain.event.projection.GameState
import eventDemo.domain.event.projection.GameStateRepository
import eventDemo.domain.event.projection.projectionListener.PlayerNotificationListener
import eventDemo.domain.notification.CommandSuccessNotification
import eventDemo.domain.notification.ItsTheTurnOfNotification
import eventDemo.domain.notification.Notification
import eventDemo.domain.notification.PlayerAsJoinTheGameNotification
import eventDemo.domain.notification.PlayerAsPlayACardNotification
import eventDemo.domain.notification.PlayerWasReadyNotification
import eventDemo.domain.notification.TheGameWasStartedNotification
import eventDemo.domain.notification.WelcomeToTheGameNotification
import eventDemo.testKoinApplicationWithConfig
import io.kotest.assertions.nondeterministic.eventually
import io.kotest.assertions.nondeterministic.until
@@ -1,15 +1,15 @@
package eventDemo.adapter.interfaceLayer.query
package eventDemo.adapter.presenter.query
import eventDemo.business.entity.Card
import eventDemo.business.entity.GameId
import eventDemo.business.entity.Player
import eventDemo.business.event.GameEventHandler
import eventDemo.business.event.event.CardIsPlayedEvent
import eventDemo.business.event.event.NewPlayerEvent
import eventDemo.business.event.event.PlayerReadyEvent
import eventDemo.business.event.event.disableShuffleDeck
import eventDemo.business.event.projection.GameState
import eventDemo.business.event.projection.GameStateRepository
import eventDemo.domain.entity.Card
import eventDemo.domain.entity.GameId
import eventDemo.domain.entity.Player
import eventDemo.domain.event.GameEventHandler
import eventDemo.domain.event.event.CardIsPlayedEvent
import eventDemo.domain.event.event.NewPlayerEvent
import eventDemo.domain.event.event.PlayerReadyEvent
import eventDemo.domain.event.event.disableShuffleDeck
import eventDemo.domain.event.projection.GameState
import eventDemo.domain.event.projection.GameStateRepository
import eventDemo.testApplicationWithConfig
import io.kotest.assertions.nondeterministic.eventually
import io.kotest.assertions.nondeterministic.until
@@ -1,4 +1,4 @@
package eventDemo.adapter.interfaceLayer.query
package eventDemo.adapter.presenter.query
import eventDemo.configuration.ktor.defaultJsonSerializer
import io.ktor.client.HttpClient
import io.ktor.client.plugins.contentnegotiation.ContentNegotiation
@@ -1,14 +1,14 @@
package eventDemo.business.command
package eventDemo.domain.command
import eventDemo.Tag
import eventDemo.business.command.command.GameCommand
import eventDemo.business.command.command.IWantToJoinTheGameCommand
import eventDemo.business.entity.GameId
import eventDemo.business.entity.Player
import eventDemo.business.event.projection.projectionListener.PlayerNotificationListener
import eventDemo.business.notification.CommandSuccessNotification
import eventDemo.business.notification.Notification
import eventDemo.business.notification.WelcomeToTheGameNotification
import eventDemo.domain.command.command.GameCommand
import eventDemo.domain.command.command.IWantToJoinTheGameCommand
import eventDemo.domain.entity.GameId
import eventDemo.domain.entity.Player
import eventDemo.domain.event.projection.projectionListener.PlayerNotificationListener
import eventDemo.domain.notification.CommandSuccessNotification
import eventDemo.domain.notification.Notification
import eventDemo.domain.notification.WelcomeToTheGameNotification
import eventDemo.testKoinApplicationWithConfig
import io.kotest.core.spec.style.FunSpec
import io.kotest.matchers.collections.shouldContain
@@ -1,4 +1,4 @@
package eventDemo.business.command
package eventDemo.domain.command
import io.kotest.core.spec.style.FunSpec
@@ -1,4 +1,4 @@
package eventDemo.business.command.command
package eventDemo.domain.command.command
import io.kotest.core.spec.style.FunSpec
@@ -1,4 +1,4 @@
package eventDemo.business.command.command
package eventDemo.domain.command.command
import io.kotest.core.spec.style.FunSpec
@@ -1,4 +1,4 @@
package eventDemo.business.command.command
package eventDemo.domain.command.command
import io.kotest.core.spec.style.FunSpec
@@ -1,4 +1,4 @@
package eventDemo.business.command.command
package eventDemo.domain.command.command
import io.kotest.core.spec.style.FunSpec
@@ -1,4 +1,4 @@
package eventDemo.business.entity
package eventDemo.domain.entity
import eventDemo.allCardCount
import eventDemo.allCards
@@ -1,4 +1,4 @@
package eventDemo.business.entity
package eventDemo.domain.entity
import io.kotest.core.spec.style.FunSpec
import io.kotest.matchers.ints.shouldBeExactly
@@ -1,4 +1,4 @@
package eventDemo.business.entity
package eventDemo.domain.entity
import io.kotest.core.spec.style.FunSpec
@@ -1,11 +1,11 @@
package eventDemo.business.event
package eventDemo.domain.event
import eventDemo.adapter.infrastructureLayer.event.GameEventBusInMemory
import eventDemo.adapter.infrastructureLayer.event.GameEventStoreInMemory
import eventDemo.business.entity.GameId
import eventDemo.business.entity.Player
import eventDemo.business.event.event.GameEvent
import eventDemo.business.event.event.NewPlayerEvent
import eventDemo.adapter.infrastructure.event.GameEventBusInMemory
import eventDemo.adapter.infrastructure.event.GameEventStoreInMemory
import eventDemo.domain.entity.GameId
import eventDemo.domain.entity.Player
import eventDemo.domain.event.event.GameEvent
import eventDemo.domain.event.event.NewPlayerEvent
import eventDemo.libs.event.VersionBuilderLocal
import io.kotest.core.spec.style.FunSpec
import io.kotest.matchers.collections.shouldHaveSize
@@ -63,7 +63,7 @@ class GameEventHandlerTest :
// When
var event: GameEvent? = null
val spy = spyk(mockk<() -> Unit>())
val spy = spyk<() -> Unit>()
eventBus.subscribe {
spy()
event = it
@@ -1,13 +1,13 @@
package eventDemo.business.event.projection
package eventDemo.domain.event.projection
import eventDemo.business.entity.Card
import eventDemo.business.entity.GameId
import eventDemo.business.entity.Player
import eventDemo.business.event.event.CardIsPlayedEvent
import eventDemo.business.event.event.GameStartedEvent
import eventDemo.business.event.event.NewPlayerEvent
import eventDemo.business.event.event.PlayerReadyEvent
import eventDemo.business.event.event.disableShuffleDeck
import eventDemo.domain.entity.Card
import eventDemo.domain.entity.GameId
import eventDemo.domain.entity.Player
import eventDemo.domain.event.event.CardIsPlayedEvent
import eventDemo.domain.event.event.GameStartedEvent
import eventDemo.domain.event.event.NewPlayerEvent
import eventDemo.domain.event.event.PlayerReadyEvent
import eventDemo.domain.event.event.disableShuffleDeck
import eventDemo.libs.event.VersionBuilderLocal
import io.kotest.core.spec.style.FunSpec
import io.kotest.matchers.equals.shouldBeEqual
@@ -1,13 +1,13 @@
package eventDemo.business.event.projection
package eventDemo.domain.event.projection
import ch.qos.logback.classic.Level
import com.rabbitmq.client.impl.ForgivingExceptionHandler
import eventDemo.Tag
import eventDemo.business.command.GameCommandHandler
import eventDemo.business.entity.GameId
import eventDemo.business.entity.Player
import eventDemo.business.event.GameEventHandler
import eventDemo.business.event.event.NewPlayerEvent
import eventDemo.domain.command.GameCommandHandler
import eventDemo.domain.entity.GameId
import eventDemo.domain.entity.Player
import eventDemo.domain.event.GameEventHandler
import eventDemo.domain.event.event.NewPlayerEvent
import eventDemo.testKoinApplicationWithConfig
import eventDemo.withLogLevel
import io.kotest.assertions.nondeterministic.eventually
@@ -1,11 +1,11 @@
package eventDemo.business.event.projection
package eventDemo.domain.event.projection
import eventDemo.business.entity.Card
import eventDemo.business.entity.Deck
import eventDemo.business.entity.Discard
import eventDemo.business.entity.GameId
import eventDemo.business.entity.Player
import eventDemo.business.entity.PlayersHands
import eventDemo.domain.entity.Card
import eventDemo.domain.entity.Deck
import eventDemo.domain.entity.Discard
import eventDemo.domain.entity.GameId
import eventDemo.domain.entity.Player
import eventDemo.domain.entity.PlayersHands
import io.kotest.core.spec.style.FunSpec
import io.kotest.matchers.equals.shouldBeEqual
@@ -1,13 +1,14 @@
package eventDemo.business.event.projection.projectionListener
package eventDemo.domain.event.projection.projectionListener
import eventDemo.adapter.infrastructureLayer.event.projection.GameProjectionBusInMemory
import eventDemo.business.entity.GameId
import eventDemo.business.entity.Player
import eventDemo.business.event.event.NewPlayerEvent
import eventDemo.business.event.projection.GameState
import eventDemo.business.notification.WelcomeToTheGameNotification
import eventDemo.adapter.infrastructure.event.projection.GameProjectionBusInMemory
import eventDemo.domain.entity.GameId
import eventDemo.domain.entity.Player
import eventDemo.domain.event.event.NewPlayerEvent
import eventDemo.domain.event.projection.GameState
import eventDemo.domain.notification.WelcomeToTheGameNotification
import io.kotest.core.spec.style.FunSpec
import io.mockk.mockk
import io.mockk.spyk
import io.mockk.verify
import kotlin.test.assertIs
@@ -24,13 +25,13 @@ class PlayerNotificationListenerTest :
lastEvent = NewPlayerEvent(gameId, player, 1),
players = setOf(player),
)
val spyCall: () -> Unit = mockk(relaxed = true)
val spy = spyk<() -> Unit>()
PlayerNotificationListener(bus).startListening(player, gameId) {
assertIs<WelcomeToTheGameNotification>(it)
spyCall()
spy()
}
bus.publish(state)
verify(exactly = 1) { spyCall() }
verify(exactly = 1) { spy() }
}
})
@@ -26,7 +26,7 @@ class RabbitMQTest :
val exchangeName = "test_" + UUID.randomUUID()
val spy = spyk(mockk<() -> Unit>())
val spy = spyk<() -> Unit>()
factory.newConnection().use { connection ->
connection
@@ -38,7 +38,7 @@ class BusTest :
)
withData(list) { bus ->
val spy = spyk(mockk<() -> Unit>())
val spy = spyk<() -> Unit>()
bus.subscribe { obj ->
spy()
@@ -3,6 +3,7 @@ package eventDemo.libs.command
import io.kotest.assertions.nondeterministic.eventually
import io.kotest.core.spec.style.FunSpec
import io.mockk.mockk
import io.mockk.spyk
import io.mockk.verify
import kotlinx.coroutines.DelicateCoroutinesApi
import kotlinx.coroutines.GlobalScope
@@ -26,19 +27,19 @@ class CommandStreamChannelTest :
val channel = Channel<CommandTest>()
val stream = CommandStreamChannel(CommandRunnerController())
val spyCall: () -> Unit = mockk(relaxed = true)
val spy = spyk<() -> Unit>()
GlobalScope.launch {
stream.process(channel) {
println("In action ${it.id}")
spyCall()
spy()
}
}
channel.send(command)
eventually(3.seconds) {
verify(exactly = 1) { spyCall() }
verify(exactly = 1) { spy() }
}
}
})