Skip to content

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

Merged
adamsaghy merged 1 commit intoapache:developfrom
Avtansh88:gsoc/modernize-payment-type-helper
Apr 9, 2026
Merged

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

Conversation

@Avtansh88
Copy link
Copy Markdown
Contributor

@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
Contributor 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
Contributor 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
Contributor 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
@adamsaghy
Copy link
Copy Markdown
Contributor

adamsaghy commented Apr 2, 2026

@Avtansh88

* What went wrong:
Execution failed for task ':integration-tests:spotlessJavaCheck'.
> The following files had format violations:
      src/test/java/org/apache/fineract/integrationtests/PaymentTypeIntegrationTest.java
          @@ -88,4 +88,4 @@
           ············//·Expected·for·404
           ········}
           ····}
          -}
          +}
      src/test/java/org/apache/fineract/integrationtests/common/PaymentTypeHelper.java
          @@ -78,4 +78,4 @@
           ····public·static·String·randomNameGenerator(final·String·prefix,·final·int·lenOfRandomSuffix)·{
           ········return·Utils.randomStringGenerator(prefix,·lenOfRandomSuffix);
           ····}
          -}
          +}
  Run './gradlew :integration-tests:spotlessApply' to fix these violations.

@Avtansh88 Avtansh88 force-pushed the gsoc/modernize-payment-type-helper branch from 26f15b4 to 7a7fe17 Compare April 2, 2026 16:35
@Avtansh88
Copy link
Copy Markdown
Contributor Author

Hi @adamsaghy,

I have applied the spotlessApply fixes to resolve the formatting violations you mentioned. All CI checks are now passing for this PR.

Regarding the commit history, I have squashed the changes into a single clean commit. This PR is now ready for your final review.

Thank you.

@Avtansh88 Avtansh88 force-pushed the gsoc/modernize-payment-type-helper branch from 7a7fe17 to d36d60e Compare April 6, 2026 20:32
@adamsaghy
Copy link
Copy Markdown
Contributor

@Avtansh88 Please rebase this PR with latest develop branch. Many of the checks were skipped due to incorrect dependency in Github Actions CI jobs!

@Avtansh88 Avtansh88 force-pushed the gsoc/modernize-payment-type-helper branch from d36d60e to 5a946fc Compare April 8, 2026 18:40
@Avtansh88 Avtansh88 force-pushed the gsoc/modernize-payment-type-helper branch from 5a946fc to 4184548 Compare April 8, 2026 18:50
@Avtansh88
Copy link
Copy Markdown
Contributor Author

Hi @adamsaghy, the PR has been successfully rebased onto the latest develop branch. I've squashed the changes into a single clean commit and verified that the file changes (3 files) are correct. Ready for another round of CI checks. Thanks.

@adamsaghy adamsaghy merged commit bea4d21 into apache:develop Apr 9, 2026
43 checks passed
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