From cca01b8e0fd5d687840ac70f3bd2692aa862ddad Mon Sep 17 00:00:00 2001 From: Everett Sochowski Date: Tue, 24 Feb 2015 16:20:00 +0100 Subject: [PATCH] Compare dates by their getTime value to avoid issues with Date object equality --- src/test/scala/code/tesobe/ImporterTest.scala | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/test/scala/code/tesobe/ImporterTest.scala b/src/test/scala/code/tesobe/ImporterTest.scala index f860bcbbb..41760f3af 100644 --- a/src/test/scala/code/tesobe/ImporterTest.scala +++ b/src/test/scala/code/tesobe/ImporterTest.scala @@ -139,8 +139,9 @@ class ImporterTest extends ServerSetup with Loggable with DefaultConnectorTestSe t.transactionType should equal(dummyKind) - t.startDate should equal(importJsonDateFormat.parse(startDate)) - t.finishDate should equal(importJsonDateFormat.parse(endDate)) + //compare time as a long to avoid issues comparing Dates, e.g. java.util.Date vs java.sql.Date + t.startDate.getTime should equal(importJsonDateFormat.parse(startDate).getTime) + t.finishDate.getTime should equal(importJsonDateFormat.parse(endDate).getTime) } scenario("Attempting to import transactions without using a secret key") {