Skip to content

Comments

FINERACT-2494: Add unit tests for ApiParameterHelper in fineract-core#5510

Draft
Ambika-Sony wants to merge 1 commit intoapache:developfrom
Ambika-Sony:FINERACT-2494-add-apiparameterhelper-tests
Draft

FINERACT-2494: Add unit tests for ApiParameterHelper in fineract-core#5510
Ambika-Sony wants to merge 1 commit intoapache:developfrom
Ambika-Sony:FINERACT-2494-add-apiparameterhelper-tests

Conversation

@Ambika-Sony
Copy link
Contributor

Description

This PR adds unit test coverage for the ApiParameterHelper utility class in the fineract-core module.

Changes:

Added ApiParameterHelperTest.java to test core methods like extractFieldsForResponseIfProvided.

Verified code formatting using ./gradlew spotlessApply.

Testing:

Successfully ran locally using: ./gradlew :fineract-core:test --tests "org.apache.fineract.infrastructure.core.api.ApiParameterHelperTest"

All tests passed (100% success rate).

Checklist

Please make sure these boxes are checked before submitting your pull request - thanks!

  • [ x] Write the commit message as per our guidelines
  • [ x] 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.
  • [ x] Create/update unit or integration tests for verifying the changes made.
  • [ x] 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
  • [ x] 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.

@Ambika-Sony Ambika-Sony force-pushed the FINERACT-2494-add-apiparameterhelper-tests branch 9 times, most recently from d3a8f13 to 03c1a73 Compare February 19, 2026 08:33
@adamsaghy
Copy link
Contributor

@Ambika-Sony Testing 1 method does not provide too much value. Would you consider to test the whole class?

@adamsaghy adamsaghy marked this pull request as draft February 19, 2026 12:27
@Ambika-Sony Ambika-Sony force-pushed the FINERACT-2494-add-apiparameterhelper-tests branch from bbe7a08 to eaf3dee Compare February 19, 2026 16:18
@Ambika-Sony
Copy link
Contributor Author

@Ambika-Sony Testing 1 method does not provide too much value. Would you consider to test the whole class?

I've Implemented pagination (limit, offset), sorting (orderBy, sortOrder), and association helpers in ApiParameterHelper.

Added 10 unit tests in ApiParameterHelperTest, covering standard scenarios, null/empty inputs, and defensive checks for whitespace handling.

Verified the build locally with ./gradlew :fineract-core:test --tests ApiParameterHelperTest (all 10 passed).

Looking forward to your feedback.

@Ambika-Sony Ambika-Sony force-pushed the FINERACT-2494-add-apiparameterhelper-tests branch 2 times, most recently from c298bf2 to 5e18810 Compare February 19, 2026 17:00
@Ambika-Sony
Copy link
Contributor Author

@adamsaghy I noticed the Cucumber E2E tests are failing in the CI, but since my changes are strictly limited to the ApiParameterHelper utility and its unit tests (2 files), these failures seem unrelated to my code. I saw your recent email about the E2E framework transition—perhaps these are known issues?

@Ambika-Sony Ambika-Sony force-pushed the FINERACT-2494-add-apiparameterhelper-tests branch 2 times, most recently from 0ef52be to c335179 Compare February 20, 2026 13:49
@Ambika-Sony Ambika-Sony force-pushed the FINERACT-2494-add-apiparameterhelper-tests branch from c335179 to 1672c0e Compare February 20, 2026 16:55
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.

2 participants