refactoring: Masive refactor to build the V2
Tests / build (push) Successful in 7m14s
Tests / lint (push) Successful in 8m35s
Tests / test (push) Failing after 11m0s

This commit is contained in:
2026-07-30 23:01:50 +02:00
parent b313b39cf4
commit e2d7942c7e
260 changed files with 5049 additions and 4753 deletions
@@ -0,0 +1,34 @@
package eventDemo.libs.command
import eventDemo.testHelpers.spyPing
import io.kotest.core.spec.style.FunSpec
import org.junit.jupiter.api.assertThrows
import kotlin.time.Duration.Companion.seconds
class CommandUnicityCheckerTest :
FunSpec({
test("runOnlyOnce must run all commands") {
spyPing(exactly = 2, duration = 3.seconds) { ping ->
val com1 = CommandForTest(CommandId())
val com2 = CommandForTest(CommandId())
CommandUnicityChecker<CommandForTest>().run {
runOnlyOnce(com1) { ping() }
runOnlyOnce(com2) { ping() }
}
}
}
test("runOnlyOnce") {
spyPing(exactly = 2, duration = 3.seconds) { ping ->
val com1 = CommandForTest(CommandId())
val com2 = CommandForTest(CommandId())
CommandUnicityChecker<CommandForTest>().run {
runOnlyOnce(com1) { ping() }
runOnlyOnce(com2) { ping() }
assertThrows<CommandUnicityChecker.UnicityException> {
runOnlyOnce(com2) { ping() }
}
}
}
}
})