FINERACT-2554: Modernize PaymentTypeHelper by removing RestAssured and using Fineract-Client#5692
Conversation
dr-fuch
left a comment
There was a problem hiding this comment.
Hi! Your deletions are correct, but if you check PaymentTypeIntegrationTest, it is still using the deprecated method: public PaymentTypeDomain retrieveById(RequestSpecification requestSpec, ResponseSpecification responseSpec, final Long paymentTypeId). You also need to update the logic in PaymentTypeIntegrationTest to avoid using it.
Don't forget to assign the Jira ticket to yourself, since you just created it.
I suggest keeping just one commit for this PR.
90adfef to
d505154
Compare
|
Hi @dr-fuch, I have addressed all the issues and squashed the commits. I've also updated the PaymentTypeIntegrationTest to ensure compatibility. Locally, the build is successful. |
96fb259 to
a4d699e
Compare
a4d699e to
63bfc71
Compare
|
Hi @adamsaghy, thank you for the approval! I noticed that some CI checks (RAT and Checkstyle) were failing due to missing license headers and formatting issues. I have just pushed a fix for these style violations. The core logic remains exactly as you approved. Ready for merge once the checks pass. Thanks. |
b9e139b to
82f38b5
Compare
82f38b5 to
5956214
Compare
|
@Avtansh88 please fix the conflicts |
ed0d737 to
11b0c38
Compare
|
Hi @adamsaghy, I have resolved the merge conflicts by rebasing with the latest develop branch. I've also squashed the changes into a single clean commit as requested. The PR now includes: ->Modernized PaymentTypeHelper using the Feign client. ->Updated PaymentTypeIntegrationTest with modernized logic. ->Removed the legacy PaymentTypeDomain file. Please let me know if any further changes are needed. Thanks |
11b0c38 to
26f15b4
Compare
Description
Background and Motivation
The PaymentTypeHelper in the integration test suite was partially using legacy RestAssured calls and manual JSON/Map handling. This approach lacked type safety and was inconsistent with the project's goal of using the OpenAPI-generated Fineract-Client. This PR aims to fully modernize the helper to ensure long-term maintainability.
Changes
->Type-Safe API Calls: Refactored the retrieveById method to use the Fineract-Client (Feign) instead of legacy RestAssured and Utils.performServerGet.
->Dependency Cleanup: Removed unused RestAssured imports (RequestSpecification, ResponseSpecification) and legacy constants like PAYMENTTYPE_URL.
->Code Optimization: Replaced manual JSON parsing (Gson/TypeToken) with direct use of the PaymentTypeData model from the Fineract SDK.
->Deleted unused PaymentTypeDomain POJO to reduce technical debt.
->Spotless Formatting: Applied standard project formatting to ensure compliance with Apache Fineract coding standards.
Related Issue
->Linked to Jira: FINERACT-2554
Tests
->Executed ./gradlew clean build -x test to verify successful compilation and spotless check.
->Verified that the modernized helper remains compatible with existing integration tests.
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.