Skip to content

Commit

Permalink
[api]: Fix unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tiagohm committed Aug 21, 2024
1 parent dd6e6d7 commit 83aadd9
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion api/src/test/kotlin/SkyAtlasServiceTest.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import SatelliteEntityRepositoryTest.Companion.ISS_TLE
import SatelliteEntityRepositoryTest.Companion.save
import SimbadEntityRepositoryTest.Companion.save
import com.fasterxml.jackson.databind.DeserializationFeature
import com.fasterxml.jackson.module.kotlin.jsonMapper
import io.kotest.matchers.collections.shouldContainAll
import io.kotest.matchers.collections.shouldHaveAtLeastSize
import io.kotest.matchers.collections.shouldHaveSize
Expand Down Expand Up @@ -158,6 +160,11 @@ class SkyAtlasServiceTest {
@JvmStatic private val SATELLITE_BOX = BOX_STORE.boxFor<SatelliteEntity>()
@JvmStatic private val SIMBAD_BOX = BOX_STORE.boxFor<SimbadEntity>()

@JvmStatic private val OBJECT_MAPPER = jsonMapper {
disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES)
disable(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY)
}

@JvmStatic private val SIMBAD_ENTITY_REPOSITORY = SimbadEntityRepository(SIMBAD_BOX).apply {
save("Sirius", SkyObjectType.STAR, Constellation.CMA, -1.45, "06 45 06".hours, "-16 43 33".deg)
save("75 Tucanae", SkyObjectType.GLOBULAR_CLUSTER, Constellation.TUC, 6.58, "01 03 12".hours, "-70 50 39".deg)
Expand All @@ -169,7 +176,7 @@ class SkyAtlasServiceTest {

@JvmStatic private val SERVICE = SkyAtlasService(
HORIZONS_EPHEMERIS_PROVIDER, BODY_EPHEMERIS_PROVIDER, SMALL_BODY_DATABASE_SERVICE,
SATELLITE_REPOSITORY, SIMBAD_ENTITY_REPOSITORY, HTTP_CLIENT
SATELLITE_REPOSITORY, SIMBAD_ENTITY_REPOSITORY, HTTP_CLIENT, OBJECT_MAPPER
)

@JvmStatic private val LOCATION = Location("-19.846616".deg, "-43.96872".deg, 852.0.m, -180)
Expand Down

0 comments on commit 83aadd9

Please sign in to comment.