Files
correx/testing/replay/src/test/kotlin/SessionEmptyReplayTest.kt
T
kami f827685ed0 chore(damn): detekt, build, tests, formatting
fixed detekt issues where possible.
fixed disttar failing build because tools is added twice in the server module.
added workflowId where required.
fixed some tests not being recognized because of runBlocking without explicit return type.
formatting + imports.
2026-05-22 00:10:05 +04:00

25 lines
807 B
Kotlin

import com.correx.core.events.types.SessionId
import com.correx.core.sessions.DefaultSessionReducer
import com.correx.core.sessions.SessionProjector
import com.correx.core.sessions.SessionStatus
import com.correx.core.sessions.projections.replay.DefaultEventReplayer
import com.correx.infrastructure.persistence.InMemoryEventStore
import org.junit.jupiter.api.Assertions.assertEquals
import org.junit.jupiter.api.Test
class SessionEmptyReplayTest {
@Test
fun `empty session returns initial state`() {
val store = InMemoryEventStore()
val replayer = DefaultEventReplayer(
store,
SessionProjector(DefaultSessionReducer())
)
val state = replayer.rebuild(SessionId("missing"))
assertEquals(SessionStatus.CREATED, state.status)
}
}