FINERACT-820 - Fixing Integration Test which fails on Sundays

This commit is contained in:
Shaik Nazeer Hussain
2020-01-25 12:18:59 +05:30
parent 1c7bea6fe0
commit e9e0bbc930
3 changed files with 13 additions and 9 deletions
@@ -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) {
@@ -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());
@@ -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);
}
}