FINERACT-2354: Reversal of re-aging transaction - remove restriction of reversal if there was payment after or on that day
This commit is contained in:
-36
@@ -380,42 +380,6 @@ class LoanReAgingValidatorTest {
|
||||
assertThat(result.getGlobalisationMessageCode()).isEqualTo("error.msg.loan.reage.reaging.transaction.missing");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testValidateUndoReAge_ShouldThrowException_WhenLoanAlreadyHasRepaymentAfterReAge() {
|
||||
// given
|
||||
List<LoanTransaction> transactions = List.of(loanTransaction(LoanTransactionType.DISBURSEMENT, actualDate.minusDays(3)),
|
||||
loanTransaction(LoanTransactionType.REAGE, actualDate.minusDays(2)),
|
||||
loanTransaction(LoanTransactionType.REPAYMENT, actualDate.minusDays(1)));
|
||||
Loan loan = loan();
|
||||
given(loan.getLoanTransactions()).willReturn(transactions);
|
||||
JsonCommand command = jsonCommand();
|
||||
// when
|
||||
GeneralPlatformDomainRuleException result = assertThrows(GeneralPlatformDomainRuleException.class,
|
||||
() -> underTest.validateUndoReAge(loan, command));
|
||||
// then
|
||||
assertThat(result).isNotNull();
|
||||
assertThat(result.getGlobalisationMessageCode()).isEqualTo("error.msg.loan.reage.repayment.exists.after.reaging");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testValidateUndoReAge_ShouldThrowException_WhenLoanAlreadyHasRepaymentAfterReAge_SameDay() {
|
||||
// given
|
||||
List<LoanTransaction> transactions = List.of(loanTransaction(LoanTransactionType.DISBURSEMENT, actualDate.minusDays(2)),
|
||||
loanTransaction(LoanTransactionType.REAGE, actualDate.minusDays(1),
|
||||
OffsetDateTime.of(actualDate, LocalTime.of(10, 0), ZoneOffset.UTC)),
|
||||
loanTransaction(LoanTransactionType.REPAYMENT, actualDate.minusDays(1),
|
||||
OffsetDateTime.of(actualDate, LocalTime.of(11, 0), ZoneOffset.UTC)));
|
||||
Loan loan = loan();
|
||||
given(loan.getLoanTransactions()).willReturn(transactions);
|
||||
JsonCommand command = jsonCommand();
|
||||
// when
|
||||
GeneralPlatformDomainRuleException result = assertThrows(GeneralPlatformDomainRuleException.class,
|
||||
() -> underTest.validateUndoReAge(loan, command));
|
||||
// then
|
||||
assertThat(result).isNotNull();
|
||||
assertThat(result.getGlobalisationMessageCode()).isEqualTo("error.msg.loan.reage.repayment.exists.after.reaging");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testValidateUndoReAge_ShouldNotThrowException_WhenLoanAlreadyHasRepaymentAfterReAge_SameDay_RepaymentBeforeReAge() {
|
||||
// given
|
||||
|
||||
Reference in New Issue
Block a user