This is an automated email from the ASF dual-hosted git repository.

nazeer1100126 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 e9e0bbc  FINERACT-820 - Fixing Integration Test which fails on Sundays
e9e0bbc is described below

commit e9e0bbc930ded7e1b3be942d237e228bacdb52b8
Author: Shaik Nazeer Hussain <[email protected]>
AuthorDate: Sat Jan 25 12:18:59 2020 +0530

    FINERACT-820 - Fixing Integration Test which fails on Sundays
---
 .../fineract/integrationtests/ClientLoanIntegrationTest.java  |  9 +--------
 .../integrationtests/LoanReschedulingWithinCenterTest.java    |  2 +-
 .../org/apache/fineract/integrationtests/common/Utils.java    | 11 +++++++++++
 3 files changed, 13 insertions(+), 9 deletions(-)

diff --git 
a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/ClientLoanIntegrationTest.java
 
b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/ClientLoanIntegrationTest.java
index c6aede4..a9b2167 100644
--- 
a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/ClientLoanIntegrationTest.java
+++ 
b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/ClientLoanIntegrationTest.java
@@ -5070,14 +5070,7 @@ public class ClientLoanIntegrationTest {
     }
 
     public Integer getDayOfWeek(Calendar date) {
-        int dayOfWeek = 0;
-        if (null != date) {
-            dayOfWeek = date.get(Calendar.DAY_OF_WEEK) - 1;
-            if (dayOfWeek == 0) {
-                dayOfWeek = 7;
-            }
-        }
-        return Integer.valueOf(dayOfWeek);
+        return Utils.getDayOfWeek(date) ;
     }
 
     public Integer getDayOfMonth(Calendar date) {
diff --git 
a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/LoanReschedulingWithinCenterTest.java
 
b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/LoanReschedulingWithinCenterTest.java
index 24d1f95..dc3b97c 100644
--- 
a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/LoanReschedulingWithinCenterTest.java
+++ 
b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/LoanReschedulingWithinCenterTest.java
@@ -175,7 +175,7 @@ public class LoanReschedulingWithinCenterTest {
         final String startDate = dateFormat.format(today.getTime());
         final String frequency = "2"; // 2:Weekly
         final String interval = "2"; // Every one week
-        final Integer repeatsOnDay = today.get(Calendar.DAY_OF_WEEK) - 1;
+        final Integer repeatsOnDay = Utils.getDayOfWeek(today) ;
 
         Integer calendarId = 
CalendarHelper.createMeetingForGroup(this.requestSpec, this.responseSpec, 
centerId, startDate, frequency,
                 interval, repeatsOnDay.toString());
diff --git 
a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/Utils.java
 
b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/Utils.java
index 68142e0..3eeefb0 100644
--- 
a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/Utils.java
+++ 
b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/Utils.java
@@ -262,5 +262,16 @@ public class Utils {
                 .andReturn().asString();
         return templateLocation.substring(1,templateLocation.length()-1);
     }
+    
+    public static Integer getDayOfWeek(Calendar date) {
+        int dayOfWeek = 0;
+        if (null != date) {
+            dayOfWeek = date.get(Calendar.DAY_OF_WEEK) - 1;
+            if (dayOfWeek == 0) {
+                dayOfWeek = 7;
+            }
+        }
+        return Integer.valueOf(dayOfWeek);
+    }
 }
 

Reply via email to