test #426

Merged
klaus merged 415 commits from test into main 2026-06-27 00:35:30 +00:00
3 changed files with 23 additions and 0 deletions
Showing only changes of commit 9489458b35 - Show all commits

View File

@@ -25,7 +25,15 @@ class CreatorRankingPeriodPolicy {
) )
} }
fun resolveVisibleFromAtUtc(aggregationEndAtKst: LocalDateTime): LocalDateTime {
return aggregationEndAtKst.plusHours(VISIBLE_DELAY_HOURS)
.atZone(KST_ZONE)
.withZoneSameInstant(UTC_ZONE)
.toLocalDateTime()
}
companion object { companion object {
private const val VISIBLE_DELAY_HOURS = 9L
private val KST_ZONE: ZoneId = ZoneId.of("Asia/Seoul") private val KST_ZONE: ZoneId = ZoneId.of("Asia/Seoul")
private val UTC_ZONE: ZoneId = ZoneId.of("UTC") private val UTC_ZONE: ZoneId = ZoneId.of("UTC")
} }

View File

@@ -0,0 +1,5 @@
package kr.co.vividnext.sodalive.v2.ranking.domain
enum class CreatorRankingType {
WEEKLY
}

View File

@@ -56,4 +56,14 @@ class CreatorRankingPeriodPolicyTest {
assertEquals(LocalDateTime.of(2026, 5, 31, 15, 0), utcRange.startInclusiveUtc) assertEquals(LocalDateTime.of(2026, 5, 31, 15, 0), utcRange.startInclusiveUtc)
assertEquals(LocalDateTime.of(2026, 6, 7, 15, 0), utcRange.endExclusiveUtc) assertEquals(LocalDateTime.of(2026, 6, 7, 15, 0), utcRange.endExclusiveUtc)
} }
@Test
@DisplayName("집계 종료일 월요일 09시 KST를 공개 노출 UTC 시각으로 변환한다")
fun shouldResolveVisibleFromAtUtcByAggregationEndAtKst() {
val aggregationEndAtKst = LocalDateTime.of(2026, 6, 8, 0, 0)
val visibleFromAtUtc = policy.resolveVisibleFromAtUtc(aggregationEndAtKst)
assertEquals(LocalDateTime.of(2026, 6, 8, 0, 0), visibleFromAtUtc)
}
} }