FINERACT-2649: Migrate Tier 1 loan integration tests to Feign client#6005
FINERACT-2649: Migrate Tier 1 loan integration tests to Feign client#6005DeathGun44 wants to merge 1 commit into
Conversation
|
@DeathGun44 pls try rebase |
97fc7c9 to
bd1f0eb
Compare
|
@Aman-Mittal Done! |
b3c87d6 to
d1fbbe7
Compare
| * Updates a loan product using raw JSON. Use this overload when you need to send explicit null values in the | ||
| * request body, which the typed Feign client cannot express due to the global NON_NULL ObjectMapper configuration. | ||
| */ | ||
| protected void updateLoanProduct(Long productId, String rawJsonBody) { |
There was a problem hiding this comment.
I understand this is a workaround, but this change will force to load restassured on every subclass, which is not ideal. Can we separate this
There was a problem hiding this comment.
Done! It's now a private method in FixedLengthLoanProductIntegrationTest.
| LoanTestValidators.verifyRepaymentSchedule(loanDetails, installments); | ||
| } | ||
|
|
||
| protected PostLoanProductsRequest create4IProgressive() { |
There was a problem hiding this comment.
Can we consolidate this kind of product creation into the LoanProductTemplates? I think this belongs there
There was a problem hiding this comment.
Done. Moved create4IProgressive() to LoanProductTemplates as a default method.
|
|
||
| public Long createClient() { | ||
| return createClient(Utils.dateFormatter.format(Utils.getLocalDateOfTenant())); | ||
| return createClient("04 March 2011"); |
There was a problem hiding this comment.
thank you ,its now fixed!
74ae125 to
db1f724
Compare
| * Updates a loan product using raw JSON. Required here because the global NON_NULL ObjectMapper prevents sending | ||
| * explicit null values through the typed Feign client. | ||
| */ | ||
| private void updateLoanProduct(Long productId, String rawJsonBody) { |
There was a problem hiding this comment.
Our plan is to completely remove RestAssured at some point in the future. I was wondering if we should instead create a fineract client with an object mapper that allows null values to be sent for this test instead? Can you look into whether we can do this?
There was a problem hiding this comment.
good point. I've replaced the REST-assured workaround with a FeignRawHttpHelper that uses java.net.HttpURLConnection directly and no REST-assured dependency at all now. this helper can also serve as a drop-in replacement for all remaining Utils.performServer* calls as we phase out REST-assured entirely.
Signed-off-by: DeathGun44 <krishnamewara841@gmail.com>
db1f724 to
0efd018
Compare
|
Updated the pr description |
|
unrelated test failures |
Summary
Migrates 5 Tier 1 loan integration tests from
BaseLoanIntegrationTest(REST-assured) toFeignLoanTestBase(Feign client).Migrated Tests
LoanPrepayAmountTestLoanProductWithChargeOffBehaviourTestLoanInterestRateFrequencyTestLoanDueCalculationTestFixedLengthLoanProductIntegrationTestInfrastructure Additions
retrieveLoanProductandupdateLoanProduct(typed) methods toFeignLoanHelperFeignRawHttpHelperfor sending raw JSON when explicitnullvalues are required, since theNON_NULLObjectMapperprevents typed null serializationLoanProductTemplates:onePeriod30DaysPeriodicAccrualfourPeriod1MonthWithoutInterestcreate4IProgressiveLoanRequestBuilders:applyLoanRequestapplyLP2ProgressiveLoanRequestapproveLoanwith expected disbursement date supportLoanTestValidators:verifyRepaymentScheduleverifyTransactionsFeignLoanTestBasewith helpers migrated fromBaseLoanIntegrationTest, including:ISO_DATE_PATTERNconstant inFeignTestConstantsandLoanTestDataBug Fixes
FeignClientHelper.createClient()04 March 2011) matchingClientHelper.DEFAULT_DATEinstead of the current system dateFeignBusinessDateHelperdateFormatparameterFeignLoanTestBase.runAt()andupdateBusinessDate()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.