test #426

Merged
klaus merged 415 commits from test into main 2026-06-27 00:35:30 +00:00
2 changed files with 16 additions and 9 deletions
Showing only changes of commit 7f13cccde0 - Show all commits

View File

@@ -24,7 +24,8 @@ enum class FcmDeepLinkValue(val value: String) {
CONTENT("content"),
SERIES("series"),
AUDITION("audition"),
COMMUNITY("community")
COMMUNITY("community"),
CHAT("chat")
}
class FcmEvent(

View File

@@ -6,22 +6,28 @@ import org.junit.jupiter.api.Test
class FcmServiceTest {
@Test
@DisplayName("메시지 푸시 data payload는 채팅 이동에 필요한 chat_type을 포함한다")
fun shouldBuildMessagePayloadWithChatType() {
@DisplayName("v2 채팅 푸시 data payload는 deep_link만 포함한다")
fun shouldBuildV2ChatPayloadWithOnlyDeepLink() {
val payload = FcmService.buildDataPayload(
roomId = 10L,
messageId = 204L,
roomId = null,
messageId = null,
contentId = null,
creatorId = null,
auditionId = null,
deepLinkValue = null,
deepLinkId = null,
deepLinkCommentPostId = null,
chatType = "USER_CREATOR"
deepLink = "voiceon-test://chat/10",
chatType = null
)
assertEquals("10", payload["room_id"])
assertEquals("204", payload["message_id"])
assertEquals("USER_CREATOR", payload["chat_type"])
assertEquals(mapOf("deep_link" to "voiceon-test://chat/10"), payload)
}
@Test
@DisplayName("v2 채팅 deep_link는 환경별 scheme과 chat room id로 생성된다")
fun shouldBuildV2ChatDeepLinkWithRoomId() {
assertEquals("voiceon://chat/10", FcmService.buildDeepLink("voiceon", FcmDeepLinkValue.CHAT, 10L))
assertEquals("voiceon-test://chat/10", FcmService.buildDeepLink("local", FcmDeepLinkValue.CHAT, 10L))
}
}