Files
sodalive-backend-spring-boot/src/test/kotlin/kr/co/vividnext/sodalive/fcm/FcmServiceTest.kt
T

34 lines
1.2 KiB
Kotlin

package kr.co.vividnext.sodalive.fcm
import org.junit.jupiter.api.Assertions.assertEquals
import org.junit.jupiter.api.DisplayName
import org.junit.jupiter.api.Test
class FcmServiceTest {
@Test
@DisplayName("v2 채팅 푸시 data payload는 deep_link만 포함한다")
fun shouldBuildV2ChatPayloadWithOnlyDeepLink() {
val payload = FcmService.buildDataPayload(
roomId = null,
messageId = null,
contentId = null,
creatorId = null,
auditionId = null,
deepLinkValue = null,
deepLinkId = null,
deepLinkCommentPostId = null,
deepLink = "voiceon-test://chat/10",
chatType = null
)
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))
}
}