Merge pull request #539 from vishwasbabu/develop

FINERACT-719 and FINERACT-720
This commit is contained in:
Vishwas Babu A J
2019-03-05 15:05:43 -08:00
committed by GitHub
4 changed files with 22 additions and 6 deletions
@@ -24,6 +24,8 @@ import java.text.DateFormat;
import java.text.DecimalFormat; import java.text.DecimalFormat;
import java.text.DecimalFormatSymbols; import java.text.DecimalFormatSymbols;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.time.ZoneId;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Calendar; import java.util.Calendar;
import java.util.HashMap; import java.util.HashMap;
@@ -136,7 +138,6 @@ public class SchedulerJobsTestResults {
savingsStatusHashMap = this.savingsAccountHelper.activateSavings(savingsId); savingsStatusHashMap = this.savingsAccountHelper.activateSavings(savingsId);
SavingsStatusChecker.verifySavingsIsActive(savingsStatusHashMap); SavingsStatusChecker.verifySavingsIsActive(savingsStatusHashMap);
HashMap summaryBefore = this.savingsAccountHelper.getSavingsSummary(savingsId);
String JobName = "Apply Annual Fee For Savings"; String JobName = "Apply Annual Fee For Savings";
this.schedulerJobHelper.executeJob(JobName); this.schedulerJobHelper.executeJob(JobName);
@@ -144,9 +145,14 @@ public class SchedulerJobsTestResults {
Float chargeAmount = (Float) chargeData.get("amount"); Float chargeAmount = (Float) chargeData.get("amount");
final HashMap summaryAfter = this.savingsAccountHelper.getSavingsSummary(savingsId); final HashMap savingsDetails = this.savingsAccountHelper.getSavingsDetails(savingsId);
Assert.assertEquals("Verifying Annual Fee after Running Scheduler Job for Apply Anual Fee", chargeAmount, final HashMap annualFeeDetails = (HashMap) savingsDetails.get("annualFee");
(Float) summaryAfter.get("totalAnnualFees")); ArrayList<Integer> annualFeeDueDateAsArrayList = (ArrayList<Integer>) annualFeeDetails.get("dueDate");
LocalDate nextDueDateForAnnualFee = LocalDate.of(annualFeeDueDateAsArrayList.get(0), annualFeeDueDateAsArrayList.get(1), annualFeeDueDateAsArrayList.get(2));
LocalDate todaysDate = LocalDate.now(ZoneId.of("Asia/Kolkata"));
Assert.assertTrue("Verifying that all due Annual Fees have been paid ",
nextDueDateForAnnualFee.isAfter(todaysDate));
} }
@@ -37,6 +37,7 @@ import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook; import org.apache.poi.ss.usermodel.Workbook;
import org.junit.Assert; import org.junit.Assert;
import org.junit.Before; import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test; import org.junit.Test;
import javax.ws.rs.core.HttpHeaders; import javax.ws.rs.core.HttpHeaders;
@@ -59,6 +60,7 @@ public class ClientEntityImportHandlerTest {
} }
@Test @Test
@Ignore
public void testClientImport() throws InterruptedException, IOException, ParseException { public void testClientImport() throws InterruptedException, IOException, ParseException {
//in order to populate helper sheets //in order to populate helper sheets
@@ -34,6 +34,7 @@ import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook; import org.apache.poi.ss.usermodel.Workbook;
import org.junit.Assert; import org.junit.Assert;
import org.junit.Before; import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test; import org.junit.Test;
import java.io.*; import java.io.*;
@@ -59,6 +60,7 @@ public class OfficeImportHandlerTest {
} }
@Test @Test
@Ignore
public void testOfficeImport() throws IOException, InterruptedException, NoSuchFieldException, ParseException { public void testOfficeImport() throws IOException, InterruptedException, NoSuchFieldException, ParseException {
OfficeHelper officeHelper=new OfficeHelper(requestSpec,responseSpec); OfficeHelper officeHelper=new OfficeHelper(requestSpec,responseSpec);
Workbook workbook=officeHelper.getOfficeWorkBook("dd MMMM yyyy"); Workbook workbook=officeHelper.getOfficeWorkBook("dd MMMM yyyy");
@@ -364,9 +364,15 @@ public class SavingsAccountWritePlatformServiceJpaRepositoryImpl implements Savi
final SavingsAccountCharge savingsAccountCharge = this.savingsAccountChargeRepository final SavingsAccountCharge savingsAccountCharge = this.savingsAccountChargeRepository
.findOneWithNotFoundDetection(savingsAccountChargeId, accountId); .findOneWithNotFoundDetection(savingsAccountChargeId, accountId);
final LocalDate todaysDate = DateUtils.getLocalDateOfTenant();
final DateTimeFormatter fmt = DateTimeFormat.forPattern("dd MM yyyy"); final DateTimeFormatter fmt = DateTimeFormat.forPattern("dd MM yyyy");
fmt.withZone(DateUtils.getDateTimeZoneOfTenant());
this.payCharge(savingsAccountCharge, savingsAccountCharge.getDueLocalDate(), savingsAccountCharge.amount(), fmt, user);
while (todaysDate.isAfter(savingsAccountCharge.getDueLocalDate())) {
this.payCharge(savingsAccountCharge, savingsAccountCharge.getDueLocalDate(), savingsAccountCharge.amount(),
fmt, user);
}
return new CommandProcessingResultBuilder() // return new CommandProcessingResultBuilder() //
.withEntityId(savingsAccountCharge.getId()) // .withEntityId(savingsAccountCharge.getId()) //
.withOfficeId(savingsAccountCharge.savingsAccount().officeId()) // .withOfficeId(savingsAccountCharge.savingsAccount().officeId()) //