aboutsummaryrefslogtreecommitdiff
path: root/wallet/src/test
diff options
context:
space:
mode:
authorTorsten Grote <t@grobox.de>2020-04-13 15:29:29 -0300
committerTorsten Grote <t@grobox.de>2020-04-13 15:29:29 -0300
commite6229b300ab59d3db0b628f3a0b0eea304f1921b (patch)
tree4258268211ee5c7abb9bc89f60cc91231d52f6cd /wallet/src/test
parent42079c0915194351bc417e2396712a11400049b3 (diff)
downloadtaler-android-e6229b300ab59d3db0b628f3a0b0eea304f1921b.tar.gz
taler-android-e6229b300ab59d3db0b628f3a0b0eea304f1921b.tar.bz2
taler-android-e6229b300ab59d3db0b628f3a0b0eea304f1921b.zip
[wallet] adapt to latest API breaking changes of wallet-core
Diffstat (limited to 'wallet/src/test')
-rw-r--r--wallet/src/test/java/net/taler/wallet/history/HistoryEventTest.kt30
1 files changed, 10 insertions, 20 deletions
diff --git a/wallet/src/test/java/net/taler/wallet/history/HistoryEventTest.kt b/wallet/src/test/java/net/taler/wallet/history/HistoryEventTest.kt
index c9fda3c..fdba2e9 100644
--- a/wallet/src/test/java/net/taler/wallet/history/HistoryEventTest.kt
+++ b/wallet/src/test/java/net/taler/wallet/history/HistoryEventTest.kt
@@ -19,6 +19,7 @@ package net.taler.wallet.history
import com.fasterxml.jackson.databind.ObjectMapper
import com.fasterxml.jackson.module.kotlin.KotlinModule
import com.fasterxml.jackson.module.kotlin.readValue
+import net.taler.common.Amount
import net.taler.wallet.history.RefreshReason.PAY
import net.taler.wallet.history.ReserveType.MANUAL
import org.junit.Assert.assertEquals
@@ -36,7 +37,7 @@ class HistoryEventTest {
proposalId = "EP5MH4R5C9RMNA06YS1QGEJ3EY682PY8R1SGRFRP74EV735N3ATG",
orderId = "2019.364-01RAQ68DQ7AWR",
merchantBaseUrl = "https://backend.demo.taler.net/public/instances/FSF/",
- amount = "KUDOS:0.5",
+ amount = Amount.fromJSONString("KUDOS:0.5"),
summary = "Essay: Foreword"
)
@@ -96,22 +97,12 @@ class HistoryEventTest {
val json = """{
"type": "reserve-balance-updated",
"eventId": "reserve-balance-updated;K0H10Q6HB9WH0CKHQQMNH5C6GA7A9AR1E2XSS9G1KG3ZXMBVT26G",
- "amountExpected": "TESTKUDOS:23",
- "amountReserveBalance": "TESTKUDOS:10",
+ "reserveAwaitedAmount": "TESTKUDOS:23",
+ "reserveUnclaimedAmount": "TESTKUDOS:0.01",
+ "reserveBalance": "TESTKUDOS:10",
"timestamp": {
"t_ms": $timestamp
},
- "newHistoryTransactions": [
- {
- "amount": "TESTKUDOS:10",
- "sender_account_url": "payto:\/\/x-taler-bank\/bank.test.taler.net\/894",
- "timestamp": {
- "t_ms": $timestamp
- },
- "wire_reference": "00000000004TR",
- "type": "DEPOSIT"
- }
- ],
"reserveShortInfo": {
"exchangeBaseUrl": "https:\/\/exchange.test.taler.net\/",
"reserveCreationDetail": {
@@ -123,10 +114,9 @@ class HistoryEventTest {
val event: ReserveBalanceUpdatedEvent = mapper.readValue(json)
assertEquals(timestamp, event.timestamp.ms)
- assertEquals("TESTKUDOS:23", event.amountExpected)
- assertEquals("TESTKUDOS:10", event.amountReserveBalance)
- assertEquals(1, event.newHistoryTransactions.size)
- assertTrue(event.newHistoryTransactions[0] is ReserveDepositTransaction)
+ assertEquals("TESTKUDOS:23", event.reserveAwaitedAmount)
+ assertEquals("TESTKUDOS:10", event.reserveBalance)
+ assertEquals("TESTKUDOS:0.01", event.reserveUnclaimedAmount)
assertEquals(exchangeBaseUrl, event.reserveShortInfo.exchangeBaseUrl)
}
@@ -134,7 +124,7 @@ class HistoryEventTest {
fun `test HistoryWithdrawnEvent`() {
val json = """{
"type": "withdrawn",
- "withdrawSessionId": "974FT7JDNR20EQKNR21G1HV9PB6T5AZHYHX9NHR51Q30ZK3T10S0",
+ "withdrawalGroupId": "974FT7JDNR20EQKNR21G1HV9PB6T5AZHYHX9NHR51Q30ZK3T10S0",
"eventId": "withdrawn;974FT7JDNR20EQKNR21G1HV9PB6T5AZHYHX9NHR51Q30ZK3T10S0",
"amountWithdrawnEffective": "TESTKUDOS:9.8",
"amountWithdrawnRaw": "TESTKUDOS:10",
@@ -151,7 +141,7 @@ class HistoryEventTest {
assertEquals(
"974FT7JDNR20EQKNR21G1HV9PB6T5AZHYHX9NHR51Q30ZK3T10S0",
- event.withdrawSessionId
+ event.withdrawalGroupId
)
assertEquals("TESTKUDOS:9.8", event.amountWithdrawnEffective)
assertEquals("TESTKUDOS:10", event.amountWithdrawnRaw)