FINERACT-2267: proper not null annotations. Remove jetbrains notnull, all services use non-null

This commit is contained in:
Attila Budai
2025-09-03 12:24:37 +02:00
committed by Adam Saghy
parent 65538495aa
commit 7378aea0b2
42 changed files with 290 additions and 285 deletions
@@ -39,9 +39,9 @@ import org.apache.fineract.integrationtests.common.Utils;
import org.apache.fineract.portfolio.loanaccount.loanschedule.domain.LoanScheduleProcessingType;
import org.apache.fineract.portfolio.loanaccount.loanschedule.domain.LoanScheduleType;
import org.apache.fineract.portfolio.loanproduct.domain.PaymentAllocationType;
import org.jetbrains.annotations.Nullable;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import org.springframework.lang.Nullable;
@Slf4j
public class LoanChargebackWithCreditAllocationsIntegrationTests extends BaseLoanIntegrationTest {
@@ -36,9 +36,9 @@ import org.apache.fineract.integrationtests.common.Utils;
import org.apache.fineract.integrationtests.common.accounting.Account;
import org.apache.fineract.integrationtests.common.products.DelinquencyBucketsHelper;
import org.apache.fineract.integrationtests.common.system.CodeHelper;
import org.jetbrains.annotations.NotNull;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import org.springframework.lang.NonNull;
public class LoanProductChargeOffReasonMappingsTest extends BaseLoanIntegrationTest {
@@ -225,7 +225,7 @@ public class LoanProductChargeOffReasonMappingsTest extends BaseLoanIntegrationT
.allowPartialPeriodInterestCalcualtion(false);//
}
@NotNull
@NonNull
private static List<PostChargeOffReasonToExpenseAccountMappings> createPostChargeOffReasonToExpenseAccountMappings(
Long chargeOffReasonId, Long glAccountId) {
List<PostChargeOffReasonToExpenseAccountMappings> chargeOffReasonToExpenseAccountMappings = new ArrayList<>();
@@ -59,10 +59,10 @@ import org.apache.fineract.integrationtests.common.loans.LoanApplicationTestBuil
import org.apache.fineract.integrationtests.common.loans.LoanProductTestBuilder;
import org.apache.fineract.integrationtests.common.loans.LoanStatusChecker;
import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper;
import org.jetbrains.annotations.NotNull;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import org.springframework.lang.NonNull;
@SuppressWarnings("rawtypes")
@Slf4j
@@ -214,7 +214,7 @@ public class CobPartitioningTest extends BaseLoanIntegrationTest {
globalConfigurationHelper.manageConfigurations(GlobalConfigurationConstants.ENABLE_AUTO_GENERATED_EXTERNAL_ID, false);
}
@NotNull
@NonNull
private Integer createClient() {
final Integer clientID = ClientHelper.createClient(REQUEST_SPEC, RESPONSE_SPEC);
Assertions.assertNotNull(clientID);
@@ -231,7 +231,7 @@ public class CobPartitioningTest extends BaseLoanIntegrationTest {
return loanProductID;
}
@NotNull
@NonNull
private Integer createLoanForClient(Integer clientID, Integer loanProductID) {
HashMap loanStatusHashMap;
@@ -25,7 +25,7 @@ import org.apache.fineract.client.models.IsCatchUpRunningDTO;
import org.apache.fineract.client.models.OldestCOBProcessedLoanDTO;
import org.apache.fineract.client.util.Calls;
import org.apache.fineract.integrationtests.common.FineractClientHelper;
import org.jetbrains.annotations.NotNull;
import org.springframework.lang.NonNull;
import retrofit2.Response;
@Slf4j
@@ -38,7 +38,7 @@ public class LoanCOBCatchUpHelper {
return Boolean.TRUE.equals(Objects.requireNonNull(response.body()).getCatchUpRunning());
}
public boolean isLoanCOBCatchUpFinishedFor(@NotNull LocalDate cobBusinessDate) {
public boolean isLoanCOBCatchUpFinishedFor(@NonNull LocalDate cobBusinessDate) {
Response<IsCatchUpRunningDTO> response = executeGetLoanCatchUpStatus();
IsCatchUpRunningDTO isCatchUpRunningResponse = Objects.requireNonNull(response.body());
OldestCOBProcessedLoanDTO getOldestCOBProcessedLoanResponse = executeRetrieveOldestCOBProcessedLoan();
@@ -78,11 +78,11 @@ import org.apache.fineract.integrationtests.common.savings.SavingsAccountHelper;
import org.apache.fineract.integrationtests.common.savings.SavingsProductHelper;
import org.apache.fineract.integrationtests.common.savings.SavingsStatusChecker;
import org.apache.fineract.integrationtests.common.system.DatatableHelper;
import org.jetbrains.annotations.NotNull;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.lang.NonNull;
public class DatatableAdvancedQueryTest {
@@ -344,7 +344,7 @@ public class DatatableAdvancedQueryTest {
return datatable;
}
@NotNull
@NonNull
private HashMap<String, Object> createDatatableEntry(String datatable, Integer apptableId, LocalDate dateValue, Boolean boolValue,
Integer intValue, BigDecimal decValue) {
final HashMap<String, Object> request = new HashMap<>();
@@ -70,10 +70,10 @@ import org.apache.fineract.integrationtests.common.loans.LoanApplicationTestBuil
import org.apache.fineract.integrationtests.common.loans.LoanProductTestBuilder;
import org.apache.fineract.integrationtests.common.loans.LoanStatusChecker;
import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper;
import org.jetbrains.annotations.NotNull;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import org.springframework.lang.NonNull;
@SuppressWarnings("rawtypes")
public class ExternalAssetOwnerTransferCancelTest extends BaseLoanIntegrationTest {
@@ -288,14 +288,14 @@ public class ExternalAssetOwnerTransferCancelTest extends BaseLoanIntegrationTes
new PutGlobalConfigurationsRequest().enabled(false));
}
@NotNull
@NonNull
private Integer createClient() {
final Integer clientID = ClientHelper.createClient(REQUEST_SPEC, RESPONSE_SPEC);
Assertions.assertNotNull(clientID);
return clientID;
}
@NotNull
@NonNull
private Integer createLoanForClient(Integer clientID) {
Integer overdueFeeChargeId = ChargesHelper.createCharges(REQUEST_SPEC, RESPONSE_SPEC,
ChargesHelper.getLoanOverdueFeeJSONWithCalculationTypePercentage("1"));
@@ -66,9 +66,9 @@ import org.apache.fineract.integrationtests.common.loans.LoanApplicationTestBuil
import org.apache.fineract.integrationtests.common.loans.LoanProductTestBuilder;
import org.apache.fineract.integrationtests.common.loans.LoanStatusChecker;
import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper;
import org.jetbrains.annotations.NotNull;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeAll;
import org.springframework.lang.NonNull;
@Slf4j
public class ExternalAssetOwnerTransferTest extends BaseLoanIntegrationTest {
@@ -177,14 +177,14 @@ public class ExternalAssetOwnerTransferTest extends BaseLoanIntegrationTest {
globalConfigurationHelper.manageConfigurations(GlobalConfigurationConstants.ENABLE_AUTO_GENERATED_EXTERNAL_ID, false);
}
@NotNull
@NonNull
protected Integer createClient() {
final Integer clientID = ClientHelper.createClient(REQUEST_SPEC, RESPONSE_SPEC);
Assertions.assertNotNull(clientID);
return clientID;
}
@NotNull
@NonNull
protected Integer createLoanForClient(Integer clientID, String transactionDate) {
Integer overdueFeeChargeId = ChargesHelper.createCharges(REQUEST_SPEC, RESPONSE_SPEC,
ChargesHelper.getLoanOverdueFeeJSONWithCalculationTypePercentage("1"));
@@ -100,11 +100,11 @@ import org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper;
import org.apache.fineract.integrationtests.common.report.ReportHelper;
import org.apache.fineract.portfolio.loanaccount.domain.LoanStatus;
import org.hamcrest.Matchers;
import org.jetbrains.annotations.NotNull;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.lang.NonNull;
@SuppressWarnings("rawtypes")
@ExtendWith({ ExternalEventsExtension.class })
@@ -1312,14 +1312,14 @@ public class InitiateExternalAssetOwnerTransferTest extends BaseLoanIntegrationT
globalConfigurationHelper.manageConfigurations(GlobalConfigurationConstants.ENABLE_AUTO_GENERATED_EXTERNAL_ID, false);
}
@NotNull
@NonNull
private Integer createClient() {
final Integer clientID = ClientHelper.createClient(REQUEST_SPEC, RESPONSE_SPEC);
Assertions.assertNotNull(clientID);
return clientID;
}
@NotNull
@NonNull
private Integer createLoanForClient(Integer clientID) {
Integer overdueFeeChargeId = ChargesHelper.createCharges(REQUEST_SPEC, RESPONSE_SPEC,
ChargesHelper.getLoanOverdueFeeJSONWithCalculationTypePercentage("1"));