fromJsonTo calls throw, they should always be wrapped if we want null results.

This commit is contained in:
Vitor Pamplona
2026-03-15 11:05:40 -04:00
parent 2c91fdea15
commit 0380927f7e
@@ -91,7 +91,7 @@ class NotificationTest {
@Test
fun testUnknownNotificationTypeReturnsNull() {
val json = """{"notification_type":"unknown_type","notification":{}}"""
val notification = OptimizedJsonMapper.fromJsonTo<Notification>(json)
val notification = runCatching { OptimizedJsonMapper.fromJsonTo<Notification>(json) }.getOrNull()
assertNull(notification)
}
}