package space.nstart.pcp.pcp_satellites_service.service

import org.junit.jupiter.api.Test
import org.mockito.Mockito.doReturn
import org.mockito.Mockito.mock
import org.mockito.Mockito.verify

class ComplexPlanRunStartupRecoveryTest {

    @Test
    fun `startup recovery invokes persistence reconciliation`() {
        val persistenceService = mock(ComplexPlanRunPersistenceService::class.java)
        doReturn(2).`when`(persistenceService).markRunningRunsFailedOnStartup()

        val recovery = ComplexPlanRunStartupRecovery(persistenceService)
        recovery.onApplicationReady()

        verify(persistenceService).markRunningRunsFailedOnStartup()
    }
}
