From 9cb66d5d6205706148e45d92ddf28124b72f8ec5 Mon Sep 17 00:00:00 2001 From: Everett Sochowski Date: Tue, 24 Feb 2015 10:17:00 +0100 Subject: [PATCH] Properly set transaction type via the transaction import api --- src/main/scala/code/tesobe/ImporterAPI.scala | 2 +- src/test/scala/code/tesobe/ImporterTest.scala | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/main/scala/code/tesobe/ImporterAPI.scala b/src/main/scala/code/tesobe/ImporterAPI.scala index d6af06355..37bfc6e5d 100644 --- a/src/main/scala/code/tesobe/ImporterAPI.scala +++ b/src/main/scala/code/tesobe/ImporterAPI.scala @@ -38,7 +38,7 @@ object ImporterAPI extends RestHelper with Loggable { */ case class ImporterBank(IBAN : String, national_identifier : String, name : String) - case class ImporterDetails(type_en : String, type_de : String, posted : ImporterDate, + case class ImporterDetails(kind : String, posted : ImporterDate, completed : ImporterDate, new_balance : ImporterAmount, value : ImporterAmount, label : String) case class ImporterDate(`$dt` : Date) //format : "2012-01-04T18:06:22.000Z" (see tests) diff --git a/src/test/scala/code/tesobe/ImporterTest.scala b/src/test/scala/code/tesobe/ImporterTest.scala index 6e16b23c9..ccecd18df 100644 --- a/src/test/scala/code/tesobe/ImporterTest.scala +++ b/src/test/scala/code/tesobe/ImporterTest.scala @@ -26,6 +26,8 @@ class ImporterTest extends ServerSetup with Loggable with DefaultConnectorTestSe val secretKeyHttpParamName = "secret" val secretKeyValue = Props.get("importer_secret").get + val dummyKind = "Transfer" + def fixture() = new { lazy val bank = createBank("a-bank") lazy val accountCurrency = "EUR" @@ -79,8 +81,7 @@ class ImporterTest extends ServerSetup with Loggable with DefaultConnectorTestSe | } | }, | "details": { - | "type_en": "Transfer", - | "type_de": "Überweisung", + | "kind": "$dummyKind", | "label": "$dummyLabel" | "posted": { | "$$dt": "$startDateString" @@ -134,6 +135,8 @@ class ImporterTest extends ServerSetup with Loggable with DefaultConnectorTestSe f } + t.transactionType should equal(dummyKind) + t.startDate should equal(importJsonDateFormat.parse(startDate)) t.finishDate should equal(importJsonDateFormat.parse(endDate)) }