package space.nstart.pcp.pcp_satellites_service.service

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

class ComplexPlanRunShutdownHandlerTest {

    @Test
    fun `context close handler marks active runs as failed`() {
        val persistenceService = mock(ComplexPlanRunPersistenceService::class.java)
        val handler = ComplexPlanRunShutdownHandler(persistenceService)

        handler.onContextClosed()

        verify(persistenceService).markActiveRunsFailedOnShutdown()
    }
}
