This is an automated email from the ASF dual-hosted git repository.
vorburger pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/fineract.git
The following commit(s) were added to refs/heads/develop by this push:
new acfec8b FINERACT-723: Fixing date comparisons that resulting in a
problem when timezone is different on database and application server
acfec8b is described below
commit acfec8bb942a1d279fa3c2445e89730d641c347a
Author: Petri Tuomola <[email protected]>
AuthorDate: Wed May 20 23:58:05 2020 +0300
FINERACT-723: Fixing date comparisons that resulting in a problem when
timezone is different on database and application server
---
.../common/shares/ShareAccountIntegrationTests.java | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git
a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/shares/ShareAccountIntegrationTests.java
b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/shares/ShareAccountIntegrationTests.java
index e2af248..1ad7dbd 100644
---
a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/shares/ShareAccountIntegrationTests.java
+++
b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/shares/ShareAccountIntegrationTests.java
@@ -201,8 +201,7 @@ public class ShareAccountIntegrationTests {
} else if (transactionType.equals("charge.payment")) {
Assert.assertEquals("2.0",
String.valueOf(transaction.get("amount")));
Assert.assertEquals("0",
String.valueOf(transaction.get("amountPaid")));
- Date transactionDate = DateUtils.getDateOfTenant() ;
- Assert.assertEquals(simple.format(transactionDate),
simple.format(date));
+
Assert.assertEquals(simple.format(Utils.getLocalDateOfTenant().toDate()),
simple.format(date));
}
}
@@ -252,8 +251,7 @@ public class ShareAccountIntegrationTests {
Calendar cal = Calendar.getInstance();
cal.set(dateList.get(0), dateList.get(1) - 1, dateList.get(2));
Date rejectedDate = cal.getTime();
- Date currentTenantDate = DateUtils.getDateOfTenant() ;
- Assert.assertEquals(simple.format(currentTenantDate),
simple.format(rejectedDate));
+
Assert.assertEquals(simple.format(Utils.getLocalDateOfTenant().toDate()),
simple.format(rejectedDate));
List<Map<String, Object>> transactions = (List<Map<String, Object>>)
shareAccountData.get("purchasedShares");
Assert.assertNotNull(transactions);
@@ -364,8 +362,7 @@ public class ShareAccountIntegrationTests {
} else if (transactionType.equals("charge.payment")) {
Assert.assertEquals("2.0",
String.valueOf(transaction.get("amount")));
Assert.assertEquals("0",
String.valueOf(transaction.get("amountPaid")));
- Date transactionDate = DateUtils.getDateOfTenant() ;
- Assert.assertEquals(simple.format(transactionDate),
simple.format(date));
+
Assert.assertEquals(simple.format(Utils.getLocalDateOfTenant().toDate()),
simple.format(date));
}
}