package com.correx.testing.contracts.model

import com.correx.core.validation.graph.GraphValidator
import com.correx.core.validation.model.ValidationContext
import com.correx.core.validation.pipeline.ValidationPipeline
import com.correx.testing.fixtures.WorkflowFixtures
import kotlinx.coroutines.runBlocking
import org.junit.jupiter.api.Assertions.assertEquals
import org.junit.jupiter.api.Test

class ValidationReportContractTest {

    @Test
    fun `report must be deterministic`(): Unit = runBlocking {

        val graph = WorkflowFixtures.simpleGraph()

        val pipeline = ValidationPipeline(
            listOf(GraphValidator())
        )

        val context = ValidationContext(graph)

        val r1 = pipeline.validate(context)
        val r2 = pipeline.validate(context)

        assertEquals(r1, r2)
    }
}
