Skip to content

FINERACT-1474: Remove hard-coded constants from ExternalCreditBureauTest - #5636

Merged
adamsaghy merged 1 commit into
apache:developfrom
debcodes076:fix-issue-1474-hardcoded-constants
Apr 2, 2026
Merged

FINERACT-1474: Remove hard-coded constants from ExternalCreditBureauTest#5636
adamsaghy merged 1 commit into
apache:developfrom
debcodes076:fix-issue-1474-hardcoded-constants

Conversation

@debcodes076

@debcodes076 debcodes076 commented Mar 16, 2026

Copy link
Copy Markdown

Description

This PR addresses Issue 1474 by refactoring the ExternalCreditBureauIntegrationWritePlatformServiceImplTest.java file and its implementation to remove hard-coded strings and magic numbers.

Changes Made

  • Vendor Neutrality: Renamed service and test classes to be neutral (e.g., ExternalCreditBureauIntegrationWritePlatformService).
  • Code Quality: Introduced private static final constants for CREDIT_BUREAU_ID, TEST_USERNAME, TEST_PASSWORD, and TEST_URL.
  • Logic Update: Refactored the setup() method and all @Test cases to utilize these constants.
  • Cascading Fixes: Updated dependent services (e.g., CreditReportWritePlatformServiceImpl) to align with the new neutral interface.

Verification & Compliance

  • Local Tests: Ran ./gradlew :fineract-provider:test --tests "org.apache.fineract.infrastructure.creditbureau.service.ExternalCreditBureauIntegrationWritePlatformServiceImplTest"BUILD SUCCESSFUL.
  • Formatting: Applied project-wide styles via ./gradlew spotlessApply.
  • Audit: Verified license compliance via ./gradlew ratPASSING.

Checklist

  • Write the commit message as per guidelines
  • Acknowledge that the build passes locally
  • Follow coding conventions

GSoC 2026 Context:

This contribution is intended as evidence of competence for GSoC 2026.
Tag: gsoc-fineract-evidence

@debcodes076
debcodes076 force-pushed the fix-issue-1474-hardcoded-constants branch from 55b4100 to 6414dbe Compare March 16, 2026 18:12

@IOhacker IOhacker left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hello, "ThitsaWorks" seems to be non neutral, it must be removed or replaced.

@debcodes076
debcodes076 force-pushed the fix-issue-1474-hardcoded-constants branch from 6414dbe to ea97caa Compare March 16, 2026 19:14
@debcodes076 debcodes076 changed the title FINERACT-1474: Remove hard-coded constants from ThitsaWorksCreditBureauTest FINERACT-1474: Remove hard-coded constants from ExternalCreditBureauTest Mar 17, 2026
@debcodes076
debcodes076 force-pushed the fix-issue-1474-hardcoded-constants branch from ea97caa to 961609c Compare March 17, 2026 09:06
@debcodes076

debcodes076 commented Mar 17, 2026

Copy link
Copy Markdown
Author

Hello, "ThitsaWorks" seems to be non neutral, it must be removed or replaced.

thank you for the feedback! i've refactored the code to replace all "Thitsaworks.." references with "ExternalCredit..." (including file name, classnames, method names) to ensure vendor neutrality.

@airajena

Copy link
Copy Markdown
Contributor

please make sure you run ./gradlew spotlessApply spotbugsMain spotbugsTest checkstyleMain checkstyleTest as pre commit

@debcodes076
debcodes076 force-pushed the fix-issue-1474-hardcoded-constants branch 2 times, most recently from f41dc03 to ac27d35 Compare March 26, 2026 10:43
@debcodes076

debcodes076 commented Mar 26, 2026

Copy link
Copy Markdown
Author

please make sure you run ./gradlew spotlessApply spotbugsMain spotbugsTest checkstyleMain checkstyleTest as pre commit

i did ran this, and came up with few failed test cases, specifically e2e , fixed them and saw "BUILD SUCCESS" now i've push commited again.
thank you for the tip!

@debcodes076
debcodes076 force-pushed the fix-issue-1474-hardcoded-constants branch from ac27d35 to 78adba2 Compare March 26, 2026 11:17
@adamsaghy
adamsaghy requested a review from IOhacker March 26, 2026 14:19
@adamsaghy
adamsaghy merged commit 71f346d into apache:develop Apr 2, 2026
44 checks passed
@debcodes076
debcodes076 deleted the fix-issue-1474-hardcoded-constants branch April 2, 2026 18:29
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.

4 participants