diff options
author | Torsten Grote <t@grobox.de> | 2022-11-17 13:53:48 -0300 |
---|---|---|
committer | Torsten Grote <t@grobox.de> | 2023-01-03 08:25:05 -0300 |
commit | 02ad9bde3e671a3566d68a6b968efe288e67d910 (patch) | |
tree | 9ff3cfc86c31def600fbdad0bba9bf103e65368f /taler-kotlin-android/src/test/java/net | |
parent | ec0738e633076e2d601a624eb8c4b06b6ebf22d8 (diff) | |
download | taler-android-02ad9bde3e671a3566d68a6b968efe288e67d910.tar.gz taler-android-02ad9bde3e671a3566d68a6b968efe288e67d910.tar.bz2 taler-android-02ad9bde3e671a3566d68a6b968efe288e67d910.zip |
Adapt to new seconds based time format
Diffstat (limited to 'taler-kotlin-android/src/test/java/net')
-rw-r--r-- | taler-kotlin-android/src/test/java/net/taler/common/ContractTermsTest.kt | 8 | ||||
-rw-r--r-- | taler-kotlin-android/src/test/java/net/taler/common/TimeTest.kt | 10 |
2 files changed, 9 insertions, 9 deletions
diff --git a/taler-kotlin-android/src/test/java/net/taler/common/ContractTermsTest.kt b/taler-kotlin-android/src/test/java/net/taler/common/ContractTermsTest.kt index f7b83a9..3e1ebc4 100644 --- a/taler-kotlin-android/src/test/java/net/taler/common/ContractTermsTest.kt +++ b/taler-kotlin-android/src/test/java/net/taler/common/ContractTermsTest.kt @@ -37,14 +37,14 @@ class ContractTermsTest { }, "fulfillment_url":"https://shop.test.taler.net/essay/1._The_Free_Software_Definition", "summary":"Essay: 1. The Free Software Definition", - "refund_deadline":{"t_ms":"never"}, - "wire_transfer_deadline":{"t_ms":1596128564000}, + "refund_deadline":{"t_s":"never"}, + "wire_transfer_deadline":{"t_s":1596128564}, "products":[], "h_wire":"KV40K023N8EC1F5100TYNS23C4XN68Y1Z3PTJSWFGTMCNYD54KT4S791V2VQ91SZANN86VDAA369M4VEZ0KR6DN71EVRRZA71K681M0", "wire_method":"x-taler-bank", "order_id":"2020.212-01M9VKEAPF76C", - "timestamp":{"t_ms":1596128114000}, - "pay_deadline":{"t_ms":"never"}, + "timestamp":{"t_s":1596128114}, + "pay_deadline":{"t_s":"never"}, "max_wire_fee":"TESTKUDOS:1", "max_fee":"TESTKUDOS:1", "wire_fee_amortization":3, diff --git a/taler-kotlin-android/src/test/java/net/taler/common/TimeTest.kt b/taler-kotlin-android/src/test/java/net/taler/common/TimeTest.kt index beda621..4049940 100644 --- a/taler-kotlin-android/src/test/java/net/taler/common/TimeTest.kt +++ b/taler-kotlin-android/src/test/java/net/taler/common/TimeTest.kt @@ -18,9 +18,9 @@ package net.taler.common import kotlinx.serialization.json.Json.Default.decodeFromString import kotlinx.serialization.json.Json.Default.encodeToString -import kotlin.random.Random import org.junit.Assert.assertEquals import org.junit.Test +import kotlin.random.Random // TODO test other functionality of Timestamp and Duration class TimeTest { @@ -29,18 +29,18 @@ class TimeTest { fun testSerialize() { for (i in 0 until 42) { val t = Random.nextLong() - assertEquals("""{"t_ms":$t}""", encodeToString(Timestamp.serializer(), Timestamp(t))) + assertEquals("""{"t_s":$t}""", encodeToString(Timestamp.serializer(), Timestamp(t))) } - assertEquals("""{"t_ms":"never"}""", encodeToString(Timestamp.serializer(), Timestamp.never())) + assertEquals("""{"t_s":"never"}""", encodeToString(Timestamp.serializer(), Timestamp.never())) } @Test fun testDeserialize() { for (i in 0 until 42) { val t = Random.nextLong() - assertEquals(Timestamp(t), decodeFromString(Timestamp.serializer(), """{ "t_ms": $t }""")) + assertEquals(Timestamp(t), decodeFromString(Timestamp.serializer(), """{ "t_s": $t }""")) } - assertEquals(Timestamp.never(), decodeFromString(Timestamp.serializer(), """{ "t_ms": "never" }""")) + assertEquals(Timestamp.never(), decodeFromString(Timestamp.serializer(), """{ "t_s": "never" }""")) } } |