feat(fcm): 채팅 deep link payload를 정리한다

This commit is contained in:
2026-06-19 03:57:12 +09:00
parent 0811f92bf5
commit 7f13cccde0
2 changed files with 16 additions and 9 deletions

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))
}
}