android: add notifications foundation with fcm channels and deep links
Some checks failed
CI / test (push) Failing after 2m10s
Some checks failed
CI / test (push) Failing after 2m10s
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
package ru.daemonlord.messenger.push
|
||||
|
||||
import org.junit.Assert.assertEquals
|
||||
import org.junit.Assert.assertNotNull
|
||||
import org.junit.Assert.assertTrue
|
||||
import org.junit.Test
|
||||
|
||||
class PushPayloadParserTest {
|
||||
|
||||
@Test
|
||||
fun parse_readsChatPayloadFromDataMap() {
|
||||
val payload = PushPayloadParser.parseData(
|
||||
data = mapOf(
|
||||
"chat_id" to "42",
|
||||
"message_id" to "99",
|
||||
"title" to "Alice",
|
||||
"body" to "Hello",
|
||||
"is_mention" to "true",
|
||||
),
|
||||
notificationTitle = null,
|
||||
notificationBody = null,
|
||||
)
|
||||
|
||||
assertNotNull(payload)
|
||||
assertEquals(42L, payload?.chatId)
|
||||
assertEquals(99L, payload?.messageId)
|
||||
assertEquals("Alice", payload?.title)
|
||||
assertEquals("Hello", payload?.body)
|
||||
assertTrue(payload?.isMention == true)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user