Skip to content

Commit

Permalink
Merge pull request apache#539 from vishwasbabu/develop
Browse files Browse the repository at this point in the history
FINERACT-719 and FINERACT-720
  • Loading branch information
vishwasbabu authored Mar 5, 2019
2 parents 2363f67 + dd09003 commit 0921e1e
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
import java.text.DecimalFormat;
import java.text.DecimalFormatSymbols;
import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.time.ZoneId;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.HashMap;
Expand Down Expand Up @@ -136,17 +138,21 @@ public void testApplyAnnualFeeForSavingsJobOutcome() throws InterruptedException
savingsStatusHashMap = this.savingsAccountHelper.activateSavings(savingsId);
SavingsStatusChecker.verifySavingsIsActive(savingsStatusHashMap);

HashMap summaryBefore = this.savingsAccountHelper.getSavingsSummary(savingsId);
String JobName = "Apply Annual Fee For Savings";

this.schedulerJobHelper.executeJob(JobName);
final HashMap chargeData = ChargesHelper.getChargeById(this.requestSpec, this.responseSpec, annualFeeChargeId);

Float chargeAmount = (Float) chargeData.get("amount");

final HashMap summaryAfter = this.savingsAccountHelper.getSavingsSummary(savingsId);
Assert.assertEquals("Verifying Annual Fee after Running Scheduler Job for Apply Anual Fee", chargeAmount,
(Float) summaryAfter.get("totalAnnualFees"));
final HashMap savingsDetails = this.savingsAccountHelper.getSavingsDetails(savingsId);
final HashMap annualFeeDetails = (HashMap) savingsDetails.get("annualFee");
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));

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
import org.apache.poi.ss.usermodel.Workbook;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;

import javax.ws.rs.core.HttpHeaders;
Expand All @@ -59,6 +60,7 @@ public void setup() {
}

@Test
@Ignore
public void testClientImport() throws InterruptedException, IOException, ParseException {

//in order to populate helper sheets
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
import org.apache.poi.ss.usermodel.Workbook;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;

import java.io.*;
Expand All @@ -59,6 +60,7 @@ public void setup(){
}

@Test
@Ignore
public void testOfficeImport() throws IOException, InterruptedException, NoSuchFieldException, ParseException {
OfficeHelper officeHelper=new OfficeHelper(requestSpec,responseSpec);
Workbook workbook=officeHelper.getOfficeWorkBook("dd MMMM yyyy");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -364,9 +364,15 @@ public CommandProcessingResult applyAnnualFee(final Long savingsAccountChargeId,
final SavingsAccountCharge savingsAccountCharge = this.savingsAccountChargeRepository
.findOneWithNotFoundDetection(savingsAccountChargeId, accountId);

final LocalDate todaysDate = DateUtils.getLocalDateOfTenant();
final DateTimeFormatter fmt = DateTimeFormat.forPattern("dd MM yyyy");

this.payCharge(savingsAccountCharge, savingsAccountCharge.getDueLocalDate(), savingsAccountCharge.amount(), fmt, user);
fmt.withZone(DateUtils.getDateTimeZoneOfTenant());

while (todaysDate.isAfter(savingsAccountCharge.getDueLocalDate())) {
this.payCharge(savingsAccountCharge, savingsAccountCharge.getDueLocalDate(), savingsAccountCharge.amount(),
fmt, user);
}

return new CommandProcessingResultBuilder() //
.withEntityId(savingsAccountCharge.getId()) //
.withOfficeId(savingsAccountCharge.savingsAccount().officeId()) //
Expand Down

0 comments on commit 0921e1e

Please sign in to comment.