Skip to content

Commit de4d046

Browse files
committed
FINERACT-2326: Deregister static mocks
1 parent 8f3ad9c commit de4d046

File tree

3 files changed

+13
-0
lines changed

3 files changed

+13
-0
lines changed

fineract-progressive-loan/src/test/java/org/apache/fineract/portfolio/loanproduct/calc/data/InterestPeriodTest.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
import org.apache.fineract.portfolio.loanproduct.domain.InterestCalculationPeriodMethod;
3636
import org.apache.fineract.portfolio.loanproduct.domain.InterestMethod;
3737
import org.apache.fineract.portfolio.loanproduct.domain.LoanProductMinimumRepaymentScheduleRelatedDetail;
38+
import org.junit.jupiter.api.AfterAll;
3839
import org.junit.jupiter.api.BeforeAll;
3940
import org.junit.jupiter.api.Test;
4041
import org.mockito.MockedStatic;
@@ -55,6 +56,11 @@ static void init() {
5556
moneyHelper.when(MoneyHelper::getMathContext).thenReturn(MC);
5657
}
5758

59+
@AfterAll
60+
static void tearDown() {
61+
moneyHelper.close();
62+
}
63+
5864
@Test
5965
void testGettersNeverReturnNull() {
6066
// Create an empty InterestPeriod with all null Money fields

fineract-progressive-loan/src/test/java/org/apache/fineract/portfolio/loanproduct/calc/data/RepaymentPeriodTest.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
import org.apache.fineract.portfolio.loanproduct.domain.InterestCalculationPeriodMethod;
3535
import org.apache.fineract.portfolio.loanproduct.domain.InterestMethod;
3636
import org.apache.fineract.portfolio.loanproduct.domain.LoanProductMinimumRepaymentScheduleRelatedDetail;
37+
import org.junit.jupiter.api.AfterAll;
3738
import org.junit.jupiter.api.BeforeAll;
3839
import org.junit.jupiter.api.Test;
3940
import org.mockito.MockedStatic;
@@ -61,6 +62,11 @@ static void init() {
6162
when(loanProductRelatedDetail.isAllowPartialPeriodInterestCalculation()).thenReturn(true);
6263
}
6364

65+
@AfterAll
66+
static void tearDown() {
67+
moneyHelper.close();
68+
}
69+
6470
@Test
6571
void testGettersNeverReturnNull() {
6672
// Create a minimal RepaymentPeriod

fineract-provider/src/test/java/org/apache/fineract/cob/loan/CheckLoanRepaymentOverdueBusinessStepTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ public void setUp() {
8585
@AfterEach
8686
public void tearDown() {
8787
ThreadLocalContextUtil.reset();
88+
MONEY_HELPER.close();
8889
}
8990

9091
@BeforeAll

0 commit comments

Comments
 (0)