Skip to content

FINERACT-2474: Add Unit Tests for ClientReadPlatformServiceImpl - #5466

Merged
adamsaghy merged 1 commit into
apache:developfrom
nidhiii128:FINERACT-TEST-client-read-service
Feb 11, 2026
Merged

FINERACT-2474: Add Unit Tests for ClientReadPlatformServiceImpl#5466
adamsaghy merged 1 commit into
apache:developfrom
nidhiii128:FINERACT-TEST-client-read-service

Conversation

@nidhiii128

Copy link
Copy Markdown
Contributor

Description

This PR introduces unit tests for ClientReadPlatformServiceImpl to improve code coverage and ensure logic reliability within the fineract-provider module.

Screenshot 2026-02-08 130809 Regression Testing Verification: The attached image shows the unit test successfully identifying a logic failure when the hierarchy search pattern is intentionally altered. This confirms the test effectively guards against logic regressions that the Java compiler would ignore.

Technical Details
Created ClientReadPlatformServiceImplTest using JUnit 5 and Mockito.
Covered the retrieveOne success scenario with mock data.
Verified error handling for ClientNotFoundException when the database returns no results.
Added validation testing for retrieveAll to ensure invalid search statuses are rejected correctly.
Applied Spotless formatting to match project standards.

Testing
Successfully ran ./gradlew :fineract-provider:test --tests "org.apache.fineract.portfolio.client.service.ClientReadPlatformServiceImplTest"

Verified local build with ./gradlew spotlessJavaCheck.

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.

@airajena

airajena commented Feb 9, 2026

Copy link
Copy Markdown
Contributor

Please squash your commits.

@nidhiii128
nidhiii128 force-pushed the FINERACT-TEST-client-read-service branch from 08010f6 to 4b937f2 Compare February 9, 2026 22:00
@nidhiii128

Copy link
Copy Markdown
Contributor Author

Please squash your commits.

@airajena done

@IOhacker

Copy link
Copy Markdown
Contributor

@nidhiii128 please make sure that the PR title and the Jira ticket title are the same.

@Aman-Mittal

Copy link
Copy Markdown
Member

@nidhiii128
rename your PR title from
FINERACT-2474 : Add Unit Tests for ClientReadPlatformServiceImpl
to
FINERACT-2474: Add Unit Tests for ClientReadPlatformServiceImpl

Check is failing due to space between FINERACT-2474 :

@adamsaghy adamsaghy changed the title FINERACT-2474 : Add Unit Tests for ClientReadPlatformServiceImpl FINERACT-2474: Add Unit Tests for ClientReadPlatformServiceImpl Feb 10, 2026
@adamsaghy

Copy link
Copy Markdown
Contributor
* What went wrong:
Execution failed for task ':fineract-provider:spotlessJavaCheck'.
> The following files had format violations:
      src/test/java/org/apache/fineract/portfolio/client/service/ClientReadPlatformServiceImplTest.java
          @@ -130,5 +130,3 @@
           ········});
           ····}
           }
          -
          -
  Run './gradlew :fineract-provider:spotlessApply' to fix these violations.

@nidhiii128
nidhiii128 force-pushed the FINERACT-TEST-client-read-service branch from 4b937f2 to f0a0e39 Compare February 10, 2026 10:49
@nidhiii128

Copy link
Copy Markdown
Contributor Author
* What went wrong:
Execution failed for task ':fineract-provider:spotlessJavaCheck'.
> The following files had format violations:
      src/test/java/org/apache/fineract/portfolio/client/service/ClientReadPlatformServiceImplTest.java
          @@ -130,5 +130,3 @@
           ········});
           ····}
           }
          -
          -
  Run './gradlew :fineract-provider:spotlessApply' to fix these violations.

@adamsaghy Done! I've run ./gradlew spotlessApply and amended the commit. It should be clean now. Thanks for the help with the title!

@adamsaghy
adamsaghy merged commit 6875645 into apache:develop Feb 11, 2026
37 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.

5 participants