FINERACT-2649: batch migrate Tier 4 loan tests to feign - #6158
Merged
adamsaghy merged 26 commits intoAug 17, 2026
Merged
Conversation
budaidev
previously approved these changes
Jul 24, 2026
budaidev
left a comment
Contributor
There was a problem hiding this comment.
I don't see any larger issues, it looks good.
Contributor
Author
|
Hi @adamsaghy can you please take a look at this one ,when you have a moment! |
DeathGun44
force-pushed
the
FINERACT-2649/batch-migrate-loan-tests-to-feign-s4
branch
from
August 5, 2026 06:33
434c2be to
882af35
Compare
Contributor
Author
|
Rebased ,also removed feignhttp calls as per the reviews on #6194 and updated pr description reflecting the current state |
DeathGun44
force-pushed
the
FINERACT-2649/batch-migrate-loan-tests-to-feign-s4
branch
from
August 5, 2026 10:51
882af35 to
c6ea6e7
Compare
DeathGun44
marked this pull request as draft
August 5, 2026 13:09
DeathGun44
force-pushed
the
FINERACT-2649/batch-migrate-loan-tests-to-feign-s4
branch
from
August 5, 2026 14:00
c6ea6e7 to
85d66cf
Compare
DeathGun44
marked this pull request as ready for review
August 5, 2026 14:45
Contributor
Author
|
test seems flaky, should pass on rerun |
Contributor
Author
|
@adamsaghy please take a look when you have a moment! |
Contributor
|
please resolve the conflict |
Contributor
|
@DeathGun44 Sorry for being slow. Let me review it now |
adamsaghy
reviewed
Aug 13, 2026
adamsaghy
reviewed
Aug 13, 2026
adamsaghy
reviewed
Aug 13, 2026
adamsaghy
requested changes
Aug 13, 2026
adamsaghy
left a comment
Contributor
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?
DeathGun44
force-pushed
the
FINERACT-2649/batch-migrate-loan-tests-to-feign-s4
branch
2 times, most recently
from
August 14, 2026 07:49
2981ae2 to
290cace
Compare
DeathGun44
marked this pull request as draft
August 14, 2026 07:50
DeathGun44
marked this pull request as ready for review
August 14, 2026 10:31
Contributor
Author
|
@adamsaghy please take a look when you have a moment! |
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>
DeathGun44
force-pushed
the
FINERACT-2649/batch-migrate-loan-tests-to-feign-s4
branch
from
August 17, 2026 19:40
e450bc9 to
ab25b41
Compare
Contributor
Author
|
@adamsaghy Done! |
Contributor
Author
|
the failed test seems flaky |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.