Запрос только аппаратов со статусом operational
This commit is contained in:
@@ -69,7 +69,6 @@ classifier:
|
|||||||
platforms-cache-ttl: 15m
|
platforms-cache-ttl: 15m
|
||||||
allowed-platform-statuses:
|
allowed-platform-statuses:
|
||||||
- OPERATIONAL
|
- OPERATIONAL
|
||||||
- STANDBY
|
|
||||||
|
|
||||||
tle:
|
tle:
|
||||||
polling:
|
polling:
|
||||||
|
|||||||
+30
@@ -0,0 +1,30 @@
|
|||||||
|
package space.nstart.pcp.pcp_request_service.service
|
||||||
|
|
||||||
|
import org.junit.jupiter.api.Test
|
||||||
|
import org.mockito.Mockito
|
||||||
|
import org.springframework.test.util.ReflectionTestUtils
|
||||||
|
import space.nstart.pcp.pcp_request_service.repository.PDCMRepository
|
||||||
|
import java.time.LocalDateTime
|
||||||
|
import kotlin.test.assertEquals
|
||||||
|
|
||||||
|
class SatelliteServiceRvaTest {
|
||||||
|
|
||||||
|
@Test
|
||||||
|
fun `getRVA returns empty list when no orbital points exist for interval`() {
|
||||||
|
val service = SatelliteService()
|
||||||
|
val pdcmRepository = Mockito.mock(PDCMRepository::class.java)
|
||||||
|
val timeStart = LocalDateTime.parse("2026-05-26T10:00:00")
|
||||||
|
val timeStop = LocalDateTime.parse("2026-05-26T13:00:00")
|
||||||
|
|
||||||
|
Mockito.`when`(pdcmRepository.findBySatelliteIdAndTimeBetween(SATELLITE_ID, timeStart, timeStop))
|
||||||
|
.thenReturn(emptyList())
|
||||||
|
|
||||||
|
ReflectionTestUtils.setField(service, "pdcmRepository", pdcmRepository)
|
||||||
|
|
||||||
|
assertEquals(emptyList(), service.getRVA(SATELLITE_ID, timeStart, timeStop))
|
||||||
|
}
|
||||||
|
|
||||||
|
private companion object {
|
||||||
|
const val SATELLITE_ID = 56756L
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -7,7 +7,7 @@ spring:
|
|||||||
import: "configserver:"
|
import: "configserver:"
|
||||||
cloud:
|
cloud:
|
||||||
config:
|
config:
|
||||||
uri: ${CONFIG_SERVER_URI:http://localhost:38888}
|
uri: ${CONFIG_SERVER_URI:http://localhost:8888}
|
||||||
fail-fast: ${CONFIG_SERVER_FAIL_FAST:true}
|
fail-fast: ${CONFIG_SERVER_FAIL_FAST:true}
|
||||||
profile: ${SPRING_CLOUD_CONFIG_PROFILE:${SPRING_PROFILES_ACTIVE:${spring.profiles.default}}}
|
profile: ${SPRING_CLOUD_CONFIG_PROFILE:${SPRING_PROFILES_ACTIVE:${spring.profiles.default}}}
|
||||||
label: ${SPRING_CLOUD_CONFIG_LABEL:master}
|
label: ${SPRING_CLOUD_CONFIG_LABEL:master}
|
||||||
|
|||||||
+2
-2
@@ -117,7 +117,7 @@ class PlatformServiceTest {
|
|||||||
val allowedPlatforms = service.loadAllowedPlatforms(now)
|
val allowedPlatforms = service.loadAllowedPlatforms(now)
|
||||||
|
|
||||||
assertEquals(8, cachedPlatforms.size)
|
assertEquals(8, cachedPlatforms.size)
|
||||||
assertEquals(listOf("operational-id", "standby-id"), allowedPlatforms.map { it.nsiId })
|
assertEquals(listOf("operational-id"), allowedPlatforms.map { it.nsiId })
|
||||||
verify(client, times(1)).fetchPlatforms()
|
verify(client, times(1)).fetchPlatforms()
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -130,7 +130,7 @@ class PlatformServiceTest {
|
|||||||
classifierProperties = ClassifierProperties(
|
classifierProperties = ClassifierProperties(
|
||||||
platformsUrl = "http://localhost",
|
platformsUrl = "http://localhost",
|
||||||
platformsCacheTtl = Duration.ofMinutes(15),
|
platformsCacheTtl = Duration.ofMinutes(15),
|
||||||
allowedPlatformStatuses = setOf("OPERATIONAL", "STANDBY")
|
allowedPlatformStatuses = setOf("OPERATIONAL")
|
||||||
),
|
),
|
||||||
clock = clock
|
clock = clock
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user