Krishna Mewara created FINERACT-2824:
----------------------------------------

             Summary: Migrate loan lifecycle and product integration tests to 
the Feign client
                 Key: FINERACT-2824
                 URL: https://issues.apache.org/jira/browse/FINERACT-2824
             Project: Apache Fineract
          Issue Type: Improvement
          Components: Test
    Affects Versions: 1.15.0
            Reporter: Krishna Mewara
            Assignee: Krishna Mewara


The loan lifecycle and loan product integration tests still drive the server 
through REST Assured request/response specifications. This ticket moves them 
onto the typed Feign client and {{{}FeignLoanTestBase{}}}, continuing the 
migration tracked under the Feign integration test epic.
h4. Scope (11 test classes, 28 tests)
 * *Loan product configuration*

 ** {{LoanProductExternalIdTest}} (2)

 ** {{LoanProductUpdateApiTest}} (2)

 ** {{LoanProductWithRepaymentDueEventConfigurationTest}} (2)

 ** {{LoanProductRepaymentStartDateConfigurationTest}} (4)

 * *Loan application*

 ** {{LoanApplicationApprovalTest}} (4)

 ** {{LoanApplicationScheduleMonthlyTest}} (4)

 ** {{LoanApplicationRejectionForLoanProductWithPeriodicAccrualAccountingTest}} 
(1)

 ** {{LoanValidationIntegrationTest}} (1)

 * *Auditing and concurrency*

 ** {{LoanAuditingIntegrationTest}} (1)

 ** {{ConcurrencyIntegrationTest}} (1)

 * *Working capital loan*

 ** {{WorkingCapitalLoanOriginatorsTest}} (6)

_Note: The COB tests named in the same area of the migration plan are already 
on the Feign client and are not part of this ticket._
h4. Schema Change

{{GetLoanProductsProductIdResponse}} in {{LoanProductsApiResourceSwagger}} did 
not declare {{{}externalId{}}}, although {{LoanProductData}} carries it and the 
endpoint returns it. The generated model therefore had no getter, so a test 
that retrieves a loan product by its external ID could not assert that the 
value round-tripped.

The field is added and asserted in {{{}LoanProductExternalIdTest{}}}. The 
change is additive.
h4. Test Helper Changes
 * New {{FeignRoleHelper}} ({{{}createRole{}}}, {{{}addPermissionsToRole{}}}), 
replacing the REST Assured {{RolesHelper}} used by the working capital loan 
originator test.

 * {{FeignUserHelper}} gains a {{createUser}} overload taking a full 
{{{}PostUsersRequest{}}}.

 * {{FeignLoanHelper}} gains {{retrieveLoanProductByExternalId}} and 
{{{}updateLoanProductByExternalId{}}}.

 * {{FeignLoanTestBase}} gains {{{}extractErrorCount{}}}, and 
{{extractErrorGlobalisationCode}} now also unwraps 
{{{}error.msg.resource.not.found{}}}, which is a generic envelope like the two 
codes it already skipped: every {{AbstractPlatformResourceNotFoundException}} 
reports it at the top of the body with the entity-specific code nested 
underneath.

_Note on {{{}DisallowBackdatedTransactionsIntegrationTest{}}}: This is listed 
against this area in the migration plan but is a savings test with no loan 
involvement. It is left to the savings and deposit ticket (FINERACT-2732) so 
that it lands with the savings helpers it needs._



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to