Uh oh!
There was an error while loading. Please reload this page.
FINERACT-2649: batch migrate Tier 4 loan tests to feign - #6158
Conversation
budaidev
left a comment
There was a problem hiding this comment.
I don't see any larger issues, it looks good.
Uh oh!
There was an error while loading. Please reload this page.
DeathGun44
commented
Jul 27, 2026
Hi @adamsaghy can you please take a look at this one ,when you have a moment! |
434c2be to
882af35CompareRebased ,also removed feignhttp calls as per the reviews on #6194 and updated pr description reflecting the current state |
882af35 to
c6ea6e7Comparec6ea6e7 to
85d66cfCompareDeathGun44
commented
Aug 5, 2026
test seems flaky, should pass on rerun |
DeathGun44
commented
Aug 7, 2026
@adamsaghy please take a look when you have a moment! |
budaidev
commented
Aug 13, 2026
please resolve the conflict |
adamsaghy
commented
Aug 13, 2026
@DeathGun44 Sorry for being slow. Let me review it now |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
adamsaghy
left a comment
There was a problem hiding this comment.
@DeathGun44 Ultimately it looks good. Great job (huge PR..).
Can you please review my concerns and advise on them?
2981ae2 to
290caceCompare@adamsaghy please take a look when you have a moment! |
Uh oh!
There was an error while loading. Please reload this page.
Signed-off-by: DeathGun44 <krishnamewara841@gmail.com>
…o Feign Signed-off-by: DeathGun44 <krishnamewara841@gmail.com>
…eign Signed-off-by: DeathGun44 <krishnamewara841@gmail.com>
Signed-off-by: DeathGun44 <krishnamewara841@gmail.com>
…tests to Feign Signed-off-by: DeathGun44 <krishnamewara841@gmail.com>
…ff tests to Feign Signed-off-by: DeathGun44 <krishnamewara841@gmail.com>
Signed-off-by: DeathGun44 <krishnamewara841@gmail.com>
… to Feign Signed-off-by: DeathGun44 <krishnamewara841@gmail.com>
Signed-off-by: DeathGun44 <krishnamewara841@gmail.com>
… to Feign Signed-off-by: DeathGun44 <krishnamewara841@gmail.com>
Signed-off-by: DeathGun44 <krishnamewara841@gmail.com>
Signed-off-by: DeathGun44 <krishnamewara841@gmail.com>
…sts to Feign Signed-off-by: DeathGun44 <krishnamewara841@gmail.com>
Signed-off-by: DeathGun44 <krishnamewara841@gmail.com>
Signed-off-by: DeathGun44 <krishnamewara841@gmail.com>
Signed-off-by: DeathGun44 <krishnamewara841@gmail.com>
…Feign Signed-off-by: DeathGun44 <krishnamewara841@gmail.com>
Signed-off-by: DeathGun44 <krishnamewara841@gmail.com>
Signed-off-by: DeathGun44 <krishnamewara841@gmail.com>
Signed-off-by: DeathGun44 <krishnamewara841@gmail.com>
Signed-off-by: DeathGun44 <krishnamewara841@gmail.com>
… Feign Signed-off-by: DeathGun44 <krishnamewara841@gmail.com>
…eign Signed-off-by: DeathGun44 <krishnamewara841@gmail.com>
Signed-off-by: DeathGun44 <krishnamewara841@gmail.com>
Move the two remaining BaseLoanIntegrationTest subclasses (LoanChargeRoundingTest, ClientChargeRoundingTest) onto FeignLoanTestBase and the typed Feign client, completing the loan integration-test migration. Loan charge assertions use the typed client throughout; the rounded-to-zero cases go through FeignLoanHelper.addLoanChargeExpectingError and assert the HTTP status and globalisation code instead of substring-matching the message. The client-charge amount field is an integer in the generated model, so the decimal amounts these rounding tests post go through FeignRawHttpHelper (the sanctioned non-RestAssured raw HTTP path) rather than retyping the API model; reads and the 400 rounded-to-zero assertion use the typed client and the raw HTTP status respectively. Test-only change. Signed-off-by: DeathGun44 <krishnamewara841@gmail.com>
e450bc9 to
ab25b41CompareDeathGun44
commented
Aug 17, 2026
@adamsaghy Done! |
DeathGun44
commented
Aug 17, 2026
the failed test seems flaky |
Uh oh!
There was an error while loading. Please reload this page.
What this PR does
fourth batch of the loan integration-test migration. It moves 54 test classes (655 test methods) off REST-assured onto the typed Feign client.
None of those 54 classes reference REST-assured any more. With this merged, 151 integration-test classes run on the typed client.
99 files changed:
FeignLoanTestBase,BaseLoanIntegrationTest)The tests assert the same things as before. This changes how they talk to the server, not what they check. The few assertions that did change are listed under "Bugs found" and each one is a fix.
Commits
26 commits, each a group of related tests (loan charges, COB, external asset owner, delinquency, advanced payment allocation, and so on).
What's covered
Bugs found
The typed client is stricter than REST-assured, so a few real problems showed up:
ChargeRequestBuildershadCHARGE_CALCULATION_TYPE_PERCENTAGE_AMOUNT_AND_INTEREST = 4, but 4 is percent-of-interest. Percent-of-amount-and-interest is 3, which is whatChargesHelperuses and what the tests meant. Every test using that builder was charging on the wrong base and still passing, because the amounts were plausible. Now usesChargeCalculationType.PERCENT_OF_AMOUNT_AND_INTEREST.testLoanCharges_INSTALMENT_FEEthe instalment numbers areLong(the request model requires it) but the schedule reports its period as anInteger.Long.equals(Integer)is always false, so the "this is the waived instalment" and "this is the paid instalment" branches never ran and the test compared against the wrong expected values. Now compared numerically.modifyLoanApplicationpassedcommandthroughMap.of(...), which rejects nulls. Three charge tests inClientLoanIntegrationTestpass null here and were throwingNullPointerExceptionbefore reaching the server. Now uses the typed query parameter, which drops a null.LoanProductTestBuilder.withDisallowExpectedDisbursements(true)also quietly turned on a 100% over-applied disbursement allowance. The migrated builder set it tofalse, which brokechargeOffbecause it disburses two 1000 tranches against a 1000 approval. Restored.CobPartitioningTestregistered the external-asset-owner COB step but had lost theASSET_TRANSFERGL mapping that step needs. The step list is tenant-wide and never restored, so this broke an unrelated later test.RuntimeExceptionas "the server rejected this", so a client-side connection failure counted as a pass. They also looked for "404" in the exception message, which includes the request path, so a report whose ID contained404hid a real failure. Both now check the HTTP status.SAME_AS_REPAYMENT_PERIODtoDAILY. Reverted.eninstead ofen_GB. Restored.verifyTransactionscomparedmanuallyReversedwithObjects.equals(item.getManuallyReversed(), tr.reversed), but the API omits that field entirely for non-reversed transactions, so the comparison wasObjects.equals(null, false)- always false, making the whole predicate unreachable. The check now treats null and false as the same state, and per review feedback it exists in both validators:LoanTestValidators(Feign) andBaseLoanIntegrationTest(REST-assured), where there was previously no check at all.Shared test infrastructure
LoanChargeCommandsApiandClientChargeCommandsApi(new). Two hand-written Feign nterfaces, bound to the generated response models, for the three request shapes the generated request models cannot express: a bodyless?command=waivePOST (the generated client always serialises at least{}, which that endpoint answers with a 500), a locale-formatted decimal amount ("50,05"), and a client-charge amount with decimal places. No JSON is built by hand. Retyping the shared models instead was rejected:PostLoansLoanIdChargesRequest.amounthas 118 call sites passing a number, andPostClientsClientIdChargesRequest.amountis anIntegerwhose correction is a breaking OpenAPI change (swagger-brake R010) that belongs in its own PR.LoanRequestBuilders- added a type-safepaymentAllocationOrder(PaymentAllocationType...)overload, replacing copies of the same private helper in individual tests.ChargeRequestBuilders- dropped its three localCHARGE_CALCULATION_TYPE_*constants. All call sites now use theChargeCalculationTypeenum, so the name and the value can't drift apart again.Checklist
Please make sure these boxes are checked before submitting your pull request - thanks!
Your assigned reviewer(s) will follow our guidelines for code reviews.