f827685ed0
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.
25 lines
807 B
Kotlin
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)
|
|
}
|
|
}
|