[
https://issues.apache.org/jira/browse/FINERACT-2649?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Krishna Mewara updated FINERACT-2649:
-------------------------------------
Description:
Migrates 5 Tier 1 loan integration tests from {{BaseLoanIntegrationTest}}
(REST-assured) to {{FeignLoanTestBase}} (Feign client).
h3. Migrated tests
* {{LoanPrepayAmountTest}}
* {{LoanProductWithChargeOffBehaviourTest}}
* {{LoanInterestRateFrequencyTest}}
* {{LoanDueCalculationTest}}
* {{FixedLengthLoanProductIntegrationTest}}
h3. Infrastructure additions
* Added {{retrieveLoanProduct}} and {{updateLoanProduct}} (typed) to
{{FeignLoanHelper}}
* Added {{FeignRawHttpHelper}} for sending raw JSON when explicit null values
are needed (the {{NON_NULL}} ObjectMapper prevents typed null serialization)
* Added loan product templates to {{LoanProductTemplates}}
({{{}onePeriod30DaysPeriodicAccrual{}}},
{{{}fourPeriod1MonthWithoutInterest{}}}, {{{}create4IProgressive{}}})
* Added request builders to {{LoanRequestBuilders}} ({{{}applyLoanRequest{}}},
{{{}applyLP2ProgressiveLoanRequest{}}}, {{approveLoan}} with expected
disbursement date)
* Added schedule and transaction validators to {{LoanTestValidators}}
* Extended {{FeignLoanTestBase}} with convenience wrappers (product builders,
installment/transaction factories)
* Centralized {{ISO_DATE_PATTERN}} constant in {{FeignTestConstants}} /
{{LoanTestData}}
h3. Bug fixes
* {{FeignClientHelper.createClient()}} — use fixed past activation date
matching {{ClientHelper.DEFAULT_DATE}}
* {{FeignBusinessDateHelper}} — added overloads accepting explicit
{{dateFormat}} parameter
* {{FeignLoanTestBase.runAt()}} / {{updateBusinessDate()}} — auto-detect date
format so migrated and existing tests remain compatible
was:
Batch migrate the first tier of legacy {{BaseLoanIntegrationTest}} importers to
the modern {{{}FeignLoanTestBase{}}}, porting necessary validation and helper
methods to close the API gap for the simplest test cases.
Scope:
# Test Validation Methods (2 methods)
* Port {{verifyTransactions}} (with {{TransactionExt}} support) and
{{verifyRepaymentSchedule}} from the legacy base class to
{{{}LoanTestValidators{}}}.
# FeignLoanTestBase Additions (7 methods)
* Factory methods: {{transaction}} and {{installment}} convenience wrappers
for {{{}LoanTestData{}}}.
* Verification delegates: {{{}verifyTransactions{}}},
{{verifyRepaymentSchedule}} linking to validators.
* Lifecycle convenience: {{{}applyAndApproveLoan{}}},
{{{}applyAndApproveProgressiveLoan{}}}, and a legacy-signature
{{{}disburseLoan{}}}.
# Loan Product Templates (3 methods)
* Add {{{}onePeriod30DaysPeriodicAccrual{}}},
{{{}onePeriod30DaysPeriodicAccrualWithAdvancedAllocation{}}}, and
{{fourPeriod1MonthWithoutInterest}} to {{{}LoanProductTemplates{}}}.
# Request Builders & Transaction Helpers (2 methods)
* Add {{applyLoanRequest}} with {{Consumer<PostLoansRequest>}} customizer
support to {{{}LoanRequestBuilders{}}}.
* Add {{applyChargebackTransaction}} to {{{}FeignTransactionHelper{}}}.
# Test Migrations (8 files)
* Migrate 8 tier-1 tests from {{BaseLoanIntegrationTest}} to
{{FeignLoanTestBase}} (replacing RestAssured specs and helpers with Feign
equivalents): {{{}LoanPrepayAmountTest{}}},
{{{}LoanProductWithChargeOffBehaviourTest{}}},
{{{}LoanInterestRateFrequencyTest{}}}, {{{}LoanDueCalculationTest{}}},
{{{}FixedLengthLoanProductIntegrationTest{}}},
{{{}ProgressiveLoanTransactionProcessorNextLastTest{}}},
{{{}LoanSummaryTest{}}}, {{{}LoanDownPaymentTransactionChargebackTest{}}}.
Files changed: {{{}LoanTestValidators.java{}}}, {{{}FeignLoanTestBase.java{}}},
{{{}LoanProductTemplates.java{}}}, {{{}LoanRequestBuilders.java{}}},
{{{}FeignTransactionHelper.java{}}}, plus 8 test classes. ~14 new methods
across 5 helper files, and 8 tests refactored.
> Batch Migrate BaseLoanIntegrationTest Importers to FeignLoanTestBase
> --------------------------------------------------------------------
>
> Key: FINERACT-2649
> URL: https://issues.apache.org/jira/browse/FINERACT-2649
> Project: Apache Fineract
> Issue Type: Improvement
> Components: Test
> Reporter: Krishna Mewara
> Assignee: Krishna Mewara
> Priority: Trivial
> Labels: feign-migration
>
> Migrates 5 Tier 1 loan integration tests from {{BaseLoanIntegrationTest}}
> (REST-assured) to {{FeignLoanTestBase}} (Feign client).
> h3. Migrated tests
> * {{LoanPrepayAmountTest}}
> * {{LoanProductWithChargeOffBehaviourTest}}
> * {{LoanInterestRateFrequencyTest}}
> * {{LoanDueCalculationTest}}
> * {{FixedLengthLoanProductIntegrationTest}}
> h3. Infrastructure additions
> * Added {{retrieveLoanProduct}} and {{updateLoanProduct}} (typed) to
> {{FeignLoanHelper}}
> * Added {{FeignRawHttpHelper}} for sending raw JSON when explicit null
> values are needed (the {{NON_NULL}} ObjectMapper prevents typed null
> serialization)
> * Added loan product templates to {{LoanProductTemplates}}
> ({{{}onePeriod30DaysPeriodicAccrual{}}},
> {{{}fourPeriod1MonthWithoutInterest{}}}, {{{}create4IProgressive{}}})
> * Added request builders to {{LoanRequestBuilders}}
> ({{{}applyLoanRequest{}}}, {{{}applyLP2ProgressiveLoanRequest{}}},
> {{approveLoan}} with expected disbursement date)
> * Added schedule and transaction validators to {{LoanTestValidators}}
> * Extended {{FeignLoanTestBase}} with convenience wrappers (product
> builders, installment/transaction factories)
> * Centralized {{ISO_DATE_PATTERN}} constant in {{FeignTestConstants}} /
> {{LoanTestData}}
> h3. Bug fixes
> * {{FeignClientHelper.createClient()}} — use fixed past activation date
> matching {{ClientHelper.DEFAULT_DATE}}
> * {{FeignBusinessDateHelper}} — added overloads accepting explicit
> {{dateFormat}} parameter
> * {{FeignLoanTestBase.runAt()}} / {{updateBusinessDate()}} — auto-detect
> date format so migrated and existing tests remain compatible
--
This message was sent by Atlassian Jira
(v8.20.10#820010)