mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-03 06:30:43 +00:00
Improve asXId and make tests pass in release and debug mode.
This commit is contained in:
committed by
Benoit Marty
parent
b081ecfb6a
commit
eb6276e09d
@@ -53,4 +53,5 @@ dependencies {
|
||||
testImplementation(libs.test.junit)
|
||||
testImplementation(libs.test.truth)
|
||||
testImplementation(projects.libraries.matrix.test)
|
||||
testImplementation(projects.tests.testutils)
|
||||
}
|
||||
|
||||
+5
-5
@@ -20,7 +20,7 @@ import com.google.common.truth.Truth.assertThat
|
||||
import io.element.android.libraries.matrix.test.AN_EVENT_ID
|
||||
import io.element.android.libraries.matrix.test.A_ROOM_ID
|
||||
import io.element.android.libraries.push.providers.api.PushData
|
||||
import org.junit.Assert.assertThrows
|
||||
import io.element.android.tests.testutils.assertNullOrThrow
|
||||
import org.junit.Test
|
||||
|
||||
class UnifiedPushParserTest {
|
||||
@@ -52,7 +52,7 @@ class UnifiedPushParserTest {
|
||||
@Test
|
||||
fun `test empty roomId`() {
|
||||
val pushParser = UnifiedPushParser()
|
||||
assertThrows(IllegalStateException::class.java) {
|
||||
assertNullOrThrow {
|
||||
pushParser.parse(UNIFIED_PUSH_DATA.replace(A_ROOM_ID.value, "").toByteArray(), aClientSecret)
|
||||
}
|
||||
}
|
||||
@@ -60,7 +60,7 @@ class UnifiedPushParserTest {
|
||||
@Test
|
||||
fun `test invalid roomId`() {
|
||||
val pushParser = UnifiedPushParser()
|
||||
assertThrows(IllegalStateException::class.java) {
|
||||
assertNullOrThrow {
|
||||
pushParser.parse(UNIFIED_PUSH_DATA.mutate(A_ROOM_ID.value, "aRoomId:domain"), aClientSecret)
|
||||
}
|
||||
}
|
||||
@@ -68,7 +68,7 @@ class UnifiedPushParserTest {
|
||||
@Test
|
||||
fun `test empty eventId`() {
|
||||
val pushParser = UnifiedPushParser()
|
||||
assertThrows(IllegalStateException::class.java) {
|
||||
assertNullOrThrow {
|
||||
pushParser.parse(UNIFIED_PUSH_DATA.mutate(AN_EVENT_ID.value, ""), aClientSecret)
|
||||
}
|
||||
}
|
||||
@@ -76,7 +76,7 @@ class UnifiedPushParserTest {
|
||||
@Test
|
||||
fun `test invalid eventId`() {
|
||||
val pushParser = UnifiedPushParser()
|
||||
assertThrows(IllegalStateException::class.java) {
|
||||
assertNullOrThrow {
|
||||
pushParser.parse(UNIFIED_PUSH_DATA.mutate(AN_EVENT_ID.value, "anEventId"), aClientSecret)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user