FINERACT-1646-backdated-transaction-available-balance-fix

This commit is contained in:
Dhaval Maniyar
2022-08-20 12:49:20 +02:00
committed by Aleksandar Vidakovic
parent c9be0a2816
commit c21ea4e1d3
7 changed files with 54 additions and 16 deletions
@@ -2973,18 +2973,20 @@ public class ClientSavingsIntegrationTest {
configurationForBackdatedTransaction();
String transactionDate = "1 July 2022";
LocalDate transactionDate = LocalDate.now(Utils.getZoneIdOfTenant()).minusDays(10);
final DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd MMMM yyyy");
String startDate = formatter.format(transactionDate);
final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec, transactionDate);
final Integer clientID = ClientHelper.createClient(this.requestSpec, this.responseSpec, startDate);
Assertions.assertNotNull(clientID);
final Integer savingsId = createSavingsAccountDailyPostingOverdraft(clientID, transactionDate);
this.savingsAccountHelper.depositToSavingsAccount(savingsId, "200", transactionDate, CommonConstants.RESPONSE_RESOURCE_ID);
final Integer savingsId = createSavingsAccountDailyPostingOverdraft(clientID, startDate);
this.savingsAccountHelper.depositToSavingsAccount(savingsId, "200", startDate, CommonConstants.RESPONSE_RESOURCE_ID);
final String jobName = "Post Interest For Savings";
this.scheduleJobHelper.executeAndAwaitJob(jobName);
final ResponseSpecification errorResponse = new ResponseSpecBuilder().expectStatusCode(403).build();
final SavingsAccountHelper validationErrorHelper = new SavingsAccountHelper(this.requestSpec, errorResponse);
List<HashMap> error = (List<HashMap>) validationErrorHelper.depositToSavingsAccount(savingsId, "3000", transactionDate,
List<HashMap> error = (List<HashMap>) validationErrorHelper.depositToSavingsAccount(savingsId, "300", startDate,
CommonConstants.RESPONSE_ERROR);
assertEquals("error.msg.savings.transaction.is.not.allowed", error.get(0).get(CommonConstants.RESPONSE_ERROR_MESSAGE_CODE));