aboutsummaryrefslogtreecommitdiff
path: root/wallet/src/test/java/net
diff options
context:
space:
mode:
authorTorsten Grote <t@grobox.de>2020-08-24 14:28:34 -0300
committerTorsten Grote <t@grobox.de>2020-08-24 14:28:34 -0300
commit35bc91761ad1f8336f331c6b04cff8bf4d9ae064 (patch)
tree330c195f60d909de5de4d156357a1f74847da70e /wallet/src/test/java/net
parentd3955c2d8ae552c22547a186ab196274e32919e7 (diff)
downloadtaler-android-35bc91761ad1f8336f331c6b04cff8bf4d9ae064.tar.gz
taler-android-35bc91761ad1f8336f331c6b04cff8bf4d9ae064.tar.bz2
taler-android-35bc91761ad1f8336f331c6b04cff8bf4d9ae064.zip
Upgrade to Kotlin 1.4
Diffstat (limited to 'wallet/src/test/java/net')
-rw-r--r--wallet/src/test/java/net/taler/wallet/backend/WalletResponseTest.kt11
1 files changed, 5 insertions, 6 deletions
diff --git a/wallet/src/test/java/net/taler/wallet/backend/WalletResponseTest.kt b/wallet/src/test/java/net/taler/wallet/backend/WalletResponseTest.kt
index d8f28c5..a81626c 100644
--- a/wallet/src/test/java/net/taler/wallet/backend/WalletResponseTest.kt
+++ b/wallet/src/test/java/net/taler/wallet/backend/WalletResponseTest.kt
@@ -21,7 +21,6 @@ import com.fasterxml.jackson.databind.ObjectMapper
import com.fasterxml.jackson.module.kotlin.KotlinModule
import com.fasterxml.jackson.module.kotlin.readValue
import kotlinx.serialization.json.Json
-import kotlinx.serialization.json.JsonConfiguration
import net.taler.lib.common.Amount
import net.taler.lib.common.AmountMixin
import net.taler.lib.common.Timestamp
@@ -32,9 +31,9 @@ import org.junit.Test
class WalletResponseTest {
- private val json = Json(
- JsonConfiguration.Stable.copy(ignoreUnknownKeys = true)
- )
+ private val json = Json {
+ ignoreUnknownKeys = true
+ }
private val mapper = ObjectMapper()
.registerModule(KotlinModule())
@@ -45,7 +44,7 @@ class WalletResponseTest {
@Test
fun testBalanceResponse() {
val serializer = WalletResponse.Success.serializer(BalanceResponse.serializer())
- val response = json.parse(
+ val response = json.decodeFromString(
serializer, """
{
"type": "response",
@@ -82,7 +81,7 @@ class WalletResponseTest {
"message":"unexpected exception: Error: BUG: invariant violation (purchase status)"
}
""".trimIndent()
- val info = json.parse(WalletErrorInfo.serializer(), infoJson)
+ val info = json.decodeFromString(WalletErrorInfo.serializer(), infoJson)
val infoJackson: WalletErrorInfo = mapper.readValue(infoJson)
println(info.userFacingMsg)
assertEquals(info.userFacingMsg, infoJackson.userFacingMsg)