package com.correx.testing.contracts.model.orchestration

import com.correx.core.transitions.execution.StageExecutionResult
import org.junit.jupiter.api.Assertions.assertEquals
import org.junit.jupiter.api.Test

class StageOutcomeTest {

    @Test
    fun `sealed exhaustiveness - all variants reachable`() {
        val results: List<StageExecutionResult> = listOf(
            StageExecutionResult.Success(emptyList()),
            StageExecutionResult.Failure("something went wrong", false),
        )

        val labels = results.map { result ->
            when (result) {
                is StageExecutionResult.Success -> "success"
                is StageExecutionResult.Failure -> "failure"
            }
        }

        assertEquals(
            listOf("success", "failure"),
            labels,
        )
    }
}
