Skip to content

Conversation

@airajena
Copy link
Contributor

Description

This PR adds comprehensive unit tests for the ExternalIdFactory class in the fineract-core module.

Changes

  • Added ExternalIdFactoryTest.java with 8 test methods covering:
    • produce(String) - tests for valid, null, empty, and blank strings
    • produce(List<String>) - tests for valid lists, mixed values, null list, and empty list

Testing

  • Tests verify that:
    • Valid strings produce ExternalId with correct value
    • Null/empty/blank strings produce empty ExternalId
    • List factory method correctly converts all values
    • Null list throws NullPointerException as expected

Related Issue

FINERACT-2421

@adamsaghy
Copy link
Contributor

> Task :fineract-loan:classes
/home/runner/work/fineract/fineract/fineract-core/src/test/java/org/apache/fineract/infrastructure/core/service/ExternalIdFactoryTest.java:49: error: reference to produce is ambiguous

@airajena
Copy link
Contributor Author

airajena commented Jan 9, 2026

> Task :fineract-loan:classes
/home/runner/work/fineract/fineract/fineract-core/src/test/java/org/apache/fineract/infrastructure/core/service/ExternalIdFactoryTest.java:49: error: reference to produce is ambiguous

Fix pushed

Copy link
Contributor

Choose a reason for hiding this comment

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

Not relevant change for testing ExternalIdFactory. Please remove!

Copy link
Contributor

Choose a reason for hiding this comment

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

Not relevant change for testing ExternalIdFactory. Please remove!

Copy link
Contributor

Choose a reason for hiding this comment

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

Not relevant change for testing ExternalIdFactory. Please remove!

Copy link
Contributor

Choose a reason for hiding this comment

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

Not relevant change for testing ExternalIdFactory. Please remove!

Copy link
Contributor

Choose a reason for hiding this comment

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

Not relevant change for testing ExternalIdFactory. Please remove!

Copy link
Contributor

Choose a reason for hiding this comment

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

Not relevant change for testing ExternalIdFactory. Please remove!

Copy link
Contributor

Choose a reason for hiding this comment

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

Not relevant change for testing ExternalIdFactory. Please remove!

Copy link
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.

Please remove not relevant changes!

airajena and others added 2 commits January 12, 2026 20:51
Cast null to String to resolve ambiguous method call between
produce(String) and produce(List<String>) overloads.
@airajena airajena force-pushed the FINERACT-2421/add-externalid-factory-tests branch from c7834eb to e38679b Compare January 13, 2026 16:14
@airajena
Copy link
Contributor Author

Please remove not relevant changes!

Done

@adamsaghy
Copy link
Contributor

@airajena Please squash you commits next time!

@adamsaghy adamsaghy merged commit 3ba476f into apache:develop Jan 15, 2026
35 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.

2 participants