FINERACT-2354: First step - basic implementation of re-aging for Interest bearing loans - Default Behavior, interestRecalculation = true, without dueDate change

This commit is contained in:
mariiaKraievska
2025-10-27 14:22:46 +01:00
committed by Adam Saghy
parent 23c1b2b8af
commit d21a1a98a2
17 changed files with 416 additions and 461 deletions
@@ -288,20 +288,6 @@ class LoanReAgingValidatorTest {
.isEqualTo("validation.msg.loan.reAge.numberOfInstallments.not.greater.than.zero");
}
@Test
public void testValidateReAge_ShouldThrowException_WhenLoanIsBeforeMaturity() {
// given
ThreadLocalContextUtil.setBusinessDates(new HashMap<>(Map.of(BusinessDateType.BUSINESS_DATE, actualDate)));
Loan loan = loan();
JsonCommand command = jsonCommand();
// when
GeneralPlatformDomainRuleException result = assertThrows(GeneralPlatformDomainRuleException.class,
() -> underTest.validateReAge(loan, command));
// then
assertThat(result).isNotNull();
assertThat(result.getGlobalisationMessageCode()).isEqualTo("error.msg.loan.reage.cannot.be.submitted.before.maturity");
}
@Test
public void testValidateReAge_ShouldThrowException_WhenStartDateIsBeforeMaturity() {
// given
@@ -350,20 +336,6 @@ class LoanReAgingValidatorTest {
.isEqualTo("error.msg.loan.reage.supported.only.for.progressive.loan.schedule.type");
}
@Test
public void testValidateReAge_ShouldThrowException_WhenLoanIsInterestBearing() {
// given
Loan loan = loan();
given(loan.isInterestBearing()).willReturn(true);
JsonCommand command = jsonCommand();
// when
GeneralPlatformDomainRuleException result = assertThrows(GeneralPlatformDomainRuleException.class,
() -> underTest.validateReAge(loan, command));
// then
assertThat(result).isNotNull();
assertThat(result.getGlobalisationMessageCode()).isEqualTo("error.msg.loan.reage.supported.only.for.non.interest.loans");
}
@Test
public void testValidateReAge_ShouldThrowException_WhenLoanIsNotActive() {
// given