Skip to content

FINERACT-2554: Modernize PaymentTypeHelper by removing RestAssured and using Fineract-Client#5692

Open
Avtansh88 wants to merge 1 commit intoapache:developfrom
Avtansh88:gsoc/modernize-payment-type-helper
Open

FINERACT-2554: Modernize PaymentTypeHelper by removing RestAssured and using Fineract-Client#5692
Avtansh88 wants to merge 1 commit intoapache:developfrom
Avtansh88:gsoc/modernize-payment-type-helper

Conversation

@Avtansh88
Copy link
Copy Markdown

@Avtansh88 Avtansh88 commented Mar 25, 2026

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!

  • Write the commit message as per our guidelines
  • Acknowledge that we will not review PRs that are not passing the build ("green") - it is your responsibility to get a proposed PR to pass the build, not primarily the project's maintainers.
  • Create/update unit or integration tests for verifying the changes made.
  • Follow our coding conventions.
  • Add required Swagger annotation and update API documentation at fineract-provider/src/main/resources/static/legacy-docs/apiLive.htm with details of any API changes
  • This PR must not be a "code dump". Large changes can be made in a branch, with assistance. Ask for help on the developer mailing list.

Your assigned reviewer(s) will follow our guidelines for code reviews.

Copy link
Copy Markdown

@dr-fuch dr-fuch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@Avtansh88 Avtansh88 force-pushed the gsoc/modernize-payment-type-helper branch 4 times, most recently from 90adfef to d505154 Compare March 26, 2026 10:32
@Avtansh88
Copy link
Copy Markdown
Author

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.

@Avtansh88 Avtansh88 force-pushed the gsoc/modernize-payment-type-helper branch 2 times, most recently from 96fb259 to a4d699e Compare March 26, 2026 15:16
Copy link
Copy Markdown
Contributor

@adamsaghy adamsaghy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Avtansh88 Avtansh88 force-pushed the gsoc/modernize-payment-type-helper branch from a4d699e to 63bfc71 Compare March 26, 2026 16:58
@Avtansh88
Copy link
Copy Markdown
Author

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.

@Avtansh88 Avtansh88 requested a review from adamsaghy March 26, 2026 18:31
@Avtansh88 Avtansh88 force-pushed the gsoc/modernize-payment-type-helper branch 2 times, most recently from b9e139b to 82f38b5 Compare March 26, 2026 19:00
@Avtansh88 Avtansh88 closed this Mar 26, 2026
@Avtansh88 Avtansh88 force-pushed the gsoc/modernize-payment-type-helper branch from 82f38b5 to 5956214 Compare March 26, 2026 19:02
@Avtansh88 Avtansh88 reopened this Mar 26, 2026
@adamsaghy
Copy link
Copy Markdown
Contributor

@Avtansh88 please fix the conflicts

@Avtansh88 Avtansh88 force-pushed the gsoc/modernize-payment-type-helper branch from ed0d737 to 11b0c38 Compare March 27, 2026 14:45
@Avtansh88
Copy link
Copy Markdown
Author

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

@Avtansh88 Avtansh88 force-pushed the gsoc/modernize-payment-type-helper branch from 11b0c38 to 26f15b4 Compare March 29, 2026 16:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants