From 2c008e0e65addd82c3359006691a36ed4efab1f5 Mon Sep 17 00:00:00 2001 From: Prakash M S <168627798+Prakash-M-S@users.noreply.github.com> Date: Wed, 18 Feb 2026 10:02:51 +0530 Subject: [PATCH] Aligned formatting with Spotless requirements --- .../domain/SavingsHelperNPExceptionTest.java | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/fineract-core/src/test/java/org/apache/fineract/portfolio/savings/domain/SavingsHelperNPExceptionTest.java b/fineract-core/src/test/java/org/apache/fineract/portfolio/savings/domain/SavingsHelperNPExceptionTest.java index 12df63faf..9452141c6 100644 --- a/fineract-core/src/test/java/org/apache/fineract/portfolio/savings/domain/SavingsHelperNPExceptionTest.java +++ b/fineract-core/src/test/java/org/apache/fineract/portfolio/savings/domain/SavingsHelperNPExceptionTest.java @@ -23,32 +23,27 @@ import static org.junit.jupiter.api.Assertions.assertTrue; import java.time.LocalDate; import java.util.ArrayList; import java.util.List; -import org.apache.fineract.infrastructure.core.domain.LocalDateInterval; // Ensure this import exists +import org.apache.fineract.infrastructure.core.domain.LocalDateInterval; import org.apache.fineract.portfolio.savings.SavingsPostingInterestPeriodType; import org.junit.jupiter.api.Test; class SavingsHelperNPExceptionTest { + private final SavingsHelper savingsHelper = new SavingsHelper(null); @Test void shouldNotThrowNullPointerExceptionWhenPostingPeriodTypeIsNull() { LocalDate start = LocalDate.of(2025, 1, 1); LocalDate end = LocalDate.of(2025, 4, 1); - - // This is the NULL that was causing the crash + SavingsPostingInterestPeriodType nullPostingPeriodType = null; Integer financialYearBeginningMonth = 1; List postInterestAsOn = new ArrayList<>(); - - List result = savingsHelper.determineInterestPostingPeriods( - start, - end, - nullPostingPeriodType, - financialYearBeginningMonth, - postInterestAsOn - ); - + + List result = savingsHelper.determineInterestPostingPeriods(start, end, nullPostingPeriodType, + financialYearBeginningMonth, postInterestAsOn); + assertTrue(result.isEmpty(), "Result should be empty when postingPeriodType is null"); } }