package space.nstart.pcp.tle_monitoring_service.service

import org.junit.jupiter.api.Assertions.assertTrue
import org.junit.jupiter.api.Test
import org.springframework.web.reactive.function.client.WebClient
import space.nstart.pcp.tle_monitoring_service.configuration.TlePollingProperties

class CelesTrakServiceTest {

    @Test
    fun `findExpired does not access satellite source when polling is disabled`() {
        val pollingSettingsService = TlePollingSettingsService(
            TlePollingProperties(enabled = false, timeoutSeconds = 30),
        )
        val service = CelesTrakService(WebClient.builder().build(), pollingSettingsService)

        val result = service.findExpired().collectList().block().orEmpty()

        assertTrue(result.isEmpty())
    }
}
