FINERACT-2326: Deregister static mocks

This commit is contained in:
Adam Saghy
2025-08-23 21:08:56 +02:00
committed by Arnold Gálovics
parent 8f3ad9c092
commit 2a29b1ca0e
2 changed files with 12 additions and 0 deletions
@@ -35,6 +35,7 @@ import org.apache.fineract.organisation.monetary.domain.MoneyHelper;
import org.apache.fineract.portfolio.loanproduct.domain.InterestCalculationPeriodMethod;
import org.apache.fineract.portfolio.loanproduct.domain.InterestMethod;
import org.apache.fineract.portfolio.loanproduct.domain.LoanProductMinimumRepaymentScheduleRelatedDetail;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import org.mockito.MockedStatic;
@@ -55,6 +56,11 @@ class InterestPeriodTest {
moneyHelper.when(MoneyHelper::getMathContext).thenReturn(MC);
}
@AfterAll
static void tearDown() {
moneyHelper.close();
}
@Test
void testGettersNeverReturnNull() {
// Create an empty InterestPeriod with all null Money fields
@@ -34,6 +34,7 @@ import org.apache.fineract.organisation.monetary.domain.MoneyHelper;
import org.apache.fineract.portfolio.loanproduct.domain.InterestCalculationPeriodMethod;
import org.apache.fineract.portfolio.loanproduct.domain.InterestMethod;
import org.apache.fineract.portfolio.loanproduct.domain.LoanProductMinimumRepaymentScheduleRelatedDetail;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import org.mockito.MockedStatic;
@@ -61,6 +62,11 @@ class RepaymentPeriodTest {
when(loanProductRelatedDetail.isAllowPartialPeriodInterestCalculation()).thenReturn(true);
}
@AfterAll
static void tearDown() {
moneyHelper.close();
}
@Test
void testGettersNeverReturnNull() {
// Create a minimal RepaymentPeriod