fineract-testing
Skill2.6k starsChanged 13 days agoApache-2.0View on GitHub
Choose, write, run and verify tests for Apache Fineract changes, covering JUnit unit tests, the fineract-provider Cucumber tests, Feign-client integration tests, the two-factor and OAuth2 suites, and Cucumber E2E scenarios. Use when adding or changing tests, when a code change needs test coverage, when a test fails, or before claiming that a change works.
We split this skill into the rules it gives an agent
16 rules. About 0 are common, 3 are distinctive, and 13 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
13
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 27
Use JUnit Jupiter, with Mockito through @ExtendWith(MockitoExtension.class), as the example in rule 2 does.
- Very specific: line 39
Run one class with ./gradlew :<module>:test --tests <ClassName>.
- Very specific: line 57
If your class needs its own @BeforeAll, give it a new name.
- Very specific: line 63
Never import io.restassured, and never add a file to config/checkstyle/restassured-baseline.xml: the FeignNoRestAssured check in …
- Very specific: line 68
If the generated model lacks a field, add it to the matching *ApiResourceSwagger class and regenerate both clients.
- Distinctive: line 76
Keep each test class self-contained, and undo any global configuration you change.
- Very specific: line 94
Put scenarios in a .feature file under fineract-e2e-tests-runner/src/test/resources/features and step definitions under …
- Very specific: line 110
Use @TestRailId:C<number> only for an existing TestRail case, because results are posted to that case …
- Distinctive: line 113
If there is none, ask in the PR rather than guessing.
- Very specific: line 117
Start a server first. For the integration suites, use the Docker stack in CONTRIBUTING.md, "Integration tests", which CI also uses.
- Very specific: line 120
Run the tests you added or changed against that server.
- Distinctive: line 122
If a test fails, run it at the base commit before blaming your change (IT-20).
- Very specific: line 124
Check the report for skipped tests.
- Very specific: line 126
If Gradle reports the test task as UP-TO-DATE or FROM-CACHE, the tests did not run.
- Very specific: line 128
Before pushing, run ./gradlew spotlessApply and the checks in .github/workflows/build-quality-checks.yml that your change touches …
- Very specific: line 134
Follow CONTRIBUTING.md, "Pull Requests".
≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Fineract Testing
Paths are relative to the repository root, and .adoc names refer to
fineract-doc/src/docs/en/chapters/testing/. Each rule below comes from the file or
check named next to it; if this skill and that source disagree, the source wins.
Choose the suite
| Suite | Where the tests live | Needs a running server | Guide |
| Unit | src/test/java of the module you changed | No | CONTRIBUTING.md, "Unit tests" |
Cucumber in fineract-provider | fineract-provider/src/test/resources/features | No | .github/workflows/build-cucumber.yml |
| Integration | integration-tests | Yes | integration.adoc, integration-feign.adoc |
| Two-factor, OAuth2 | twofactor-tests, oauth2-tests | Yes, started in that auth mode | integration.adoc, "Authentication modes" |
| Cucumber E2E | fineract-e2e-tests-runner (features), fineract-e2e-tests-core (steps) | Yes | cucumber.adoc |
The build never starts a server. Start one before running any suite marked "Yes",
or every API call fails (CONTRIBUTING.md, "How to run tests").
Unit tests
- Use JUnit Jupiter, with Mockito through
@ExtendWith(MockitoExtension.class), as the example in rule 2 does. The modules exclude the JUnit 4 vintage engine (for examplefineract-provider/dependencies.gradle), so a JUnit 4@Testnever runs. - Code that reads the tenant or the business date needs the thread context. Set it in
@BeforeEachand clear it withThreadLocalContextUtil.reset()in@AfterEach.Moneyalso needs the tenant's rounding mode, which sits in a static cache thatreset()does not clear: set it withMoneyHelper.initializeTenantRoundingModeand remove it withMoneyHelper.clearCacheForTenant, asfineract-working-capital-loan/src/test/java/org/apache/fineract/portfolio/workingcapitalloan/service/WorkingCapitalLoanAsOfBalanceReadServiceImplTest.javadoes. - Let exceptions propagate instead of catching them. To test a failure, use
assertThrows, not@Test(expected = ...)(CONTRIBUTING.md, "Error Handling"). - Run one class with
./gradlew :<module>:test --tests <ClassName>. The command for the whole fast suite is inCONTRIBUTING.md, "Unit tests". If you changedfineract-provider, also run./gradlew :fineract-provider:cucumber, becausetestdoes not run its features.
Integration tests
New integration tests call the server through the generated Feign client. Read rules
IT-01 to IT-20 in integration-feign.adoc before writing one.
- Extend the base class for the product under test:
FeignLoanTestBase,FeignSavingsTestBase,FeignWorkingCapitalTestBaseorFeignDepositTestBaseinintegration-tests/src/test/java/org/apache/fineract/integrationtests/client/feign/, otherwiseFeignIntegrationTestone directory up. - The loan and savings bases register
LoanTestLifecycleExtensionandFeignSavingsLifecycleExtension. Before and after every test, these close, un-approve or reject every open loan or savings account in the tenant, so create accounts inside each test, not in@BeforeAll. - If your class needs its own
@BeforeAll, give it a new name. Reusing the base method's name (setupHelpers,setupSavingsHelpers,setupWorkingCapitalHelpers,setupDepositHelpers) hides it, and the base helpers are never set up. - Make calls through
FeignCalls(ok,executeVoid,fail,failVoid) fromfineract-client-feign/src/main/java/org/apache/fineract/client/feign/util/FeignCalls.java, and assert the exact status and error code of a failure (IT-02, IT-10). - Never import
io.restassured, and never add a file toconfig/checkstyle/restassured-baseline.xml: theFeignNoRestAssuredcheck inconfig/checkstyle/checkstyle.xmlfails the build. A test you migrate off REST Assured deletes its baseline entry in the same change (integration-feign.adoc, "The Baseline"). - If the generated model lacks a field, add it to the matching
*ApiResourceSwaggerclass and regenerate both clients. Do not work around it in the test (IT-05, "Fixing a Generated Model at Source"). - For anything that depends on the date, run the steps inside
runAt(date, ...). The loan, savings and working capital bases provide it; elsewhere, callrunAton aFeignBusinessDateHelper(integration-tests/src/test/java/org/apache/fineract/integrationtests/client/feign/helpers/FeignBusinessDateHelper.java). It turns the business date on, sets it, and turns it off again afterwards. - Keep each test class self-contained, and undo any global configuration you change.
CI splits test classes across shards on each of PostgreSQL, MySQL and MariaDB
(
.github/workflows/build-postgresql.ymland its MySQL and MariaDB variants), so no class can rely on another one having run.
Keep the default lists in sync
Some tests compare the database with a list kept by hand. When your change adds one of these, update the list in the same change:
| When you add | Also update | Otherwise this fails |
A global configuration (c_configuration row) | GlobalConfigurationHelper.getAllDefaultGlobalConfigurations() in integration-tests/src/test/java/org/apache/fineract/integrationtests/common/GlobalConfigurationHelper.java | Tests that reset global configurations, such as GlobalConfigurationTest |
A scheduler job (JobName value) | Its job row, inserted by a Liquibase changeset | SchedulerJobsTest, which compares the two counts |
| An external business event type | ExternalEventConfigurationTestData in integration-tests/src/test/java/org/apache/fineract/integrationtests/client/feign/modules/ | ExternalEventConfigurationIntegrationTest |
Cucumber E2E scenarios
- Put scenarios in a
.featurefile underfineract-e2e-tests-runner/src/test/resources/featuresand step definitions underfineract-e2e-tests-core/src/test/java/org/apache/fineract/test/stepdef(cucumber.adoc, "Writing New E2E Tests"). - On a fresh database, run once with
INITIALIZATION_ENABLED=trueto create the products and charges the scenarios expect, and enable the business date (cucumber.adoc, "Test Data Initialization" and "Business Date Configuration"). - From
fineract-e2e-tests-runner, run one feature with../gradlew cucumber -Pcucumber.features="src/test/resources/features/<Name>.feature", and filter with-Pcucumber.tags. A filter that matches nothing reports0 scenariosand still exits 0, so read the summary line (integration.adoc, "The WAR deployment"). - Event assertions are skipped unless
EVENT_VERIFICATION_ENABLED=true. E2E CI sets it and runs ActiveMQ (.github/workflows/build-e2e-tests.yml,docker-compose-postgresql-test-activemq.yml), so a local run without it does not check events. - Use
@TestRailId:C<number>only for an existing TestRail case, because results are posted to that case (fineract-e2e-tests-core/src/test/java/org/apache/fineract/test/testrail/TestRailClient.java). If there is none, ask in the PR rather than guessing.
Run and verify
- Start a server first. For the integration suites, use the Docker stack in
CONTRIBUTING.md, "Integration tests", which CI also uses; that section also covers running without Docker. For E2E, see the previous section. - Run the tests you added or changed against that server. Compiling and
spotlessCheckare not verification (IT-18). - If a test fails, run it at the base commit before blaming your change (IT-20). If your change touches server code, rebuild and restart the server at the base commit too.
- Check the report for skipped tests. Some
fineract-providertests are skipped, not failed, when Docker is not running (@Testcontainers(disabledWithoutDocker = true)). - If Gradle reports the test task as
UP-TO-DATEorFROM-CACHE, the tests did not run. Add--rerun-tasks(CONTRIBUTING.md, "How to run tests"). - Before pushing, run
./gradlew spotlessApplyand the checks in.github/workflows/build-quality-checks.ymlthat your change touches (Checkstyle, Spotless, SpotBugs, RAT, Javadoc).
Flaky tests
Follow CONTRIBUTING.md, "Pull Requests". First rule out your own change ("Run and
verify", step 3). Search JIRA for the test; if there is no report, file one and link it
to FINERACT-850. Propose @Disabled // TODO FINERACT-NNNN only when comments show the
test failing in at least 3 past PRs, and only in a separate PR.
Trending
More talk lately.about the whole repository
Who's talking about apache/fineract
- A Hacker News story“Apache Fineract: Open-Source Core Banking for Financial Inclusion”Hacker News · Oct 4, 2024 · 5 points
- openMF/community-app“CORS errors prevent running locally”GitHub · Mar 29, 2020 · 3 reactions
- spring-projects/spring-batch“StepSynchronizationManager caches wrong StepExecution context in a multitenant environment”GitHub · Feb 26, 2025 · 2 reactions
- dependabot/dependabot-core“How to use Dependabot on a large GitHub Org such as https://github.com/apache/ (without write access)”GitHub · May 9, 2020 · 2 reactions
- A Hacker News story“Apache Fineract”Hacker News · Jan 30, 2019 · 2 points
The biggest 5 of 54 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 54
Talked about on GitHub, Hacker News and Stack Overflow (54 times).
On GitHub · 50
- Mar 29, 2020CORS errors prevent running locally — openMF/community-app3 reactions · 4 comments
- Feb 26, 2025StepSynchronizationManager caches wrong StepExecution context in a multitenant environment — spring-projects/spring-batch2 reactions · 2 comments
- May 9, 2020How to use Dependabot on a large GitHub Org such as https://github.com/apache/ (without write access) — dependabot/dependabot-core2 reactions · 4 comments
- Feb 6, 2026MVP for archiving #fineract slack chat messages — apache/fineract-chat-archive1 reaction · 7 comments
- Jul 10, 2025(CRED-101):fixes missing paymentOption that was not being returned as… — fitercx/fineract1 reaction
45 more on GitHub
- Dec 6, 2023Optimize search for loan and client — openMF/web-app1 reaction
- Jun 1, 2020extend CompareToZero doc — google/error-prone1 reaction · 3 comments
- Oct 30, 2026Feature/15902 capitalized charge accounting — Chathu94/fineract0 reactions
- Oct 30, 2026CGLT-797 fix repayment being reversed on waive charge — Inkomoko-Dev/fineract-template0 reactions
- Oct 29, 2026Add support for third party payment liability in accounting processes — Chathu94/fineract0 reactions
- Oct 29, 2026IP-57: report failed client, journal entry and job runs to ingestion — Inkomoko-Dev/fineract-template0 reactions
- Oct 27, 2026feat(LMS-159): later backdated partial repayment and validation — fitercx/fineract0 reactions
- Oct 27, 2026CGLT-795: Build the invitation email CBS link from the configured system URL and drop the uncertified www host. — Inkomoko-Dev/fineract-template0 reactions
- Oct 27, 2026Loan charge payment overpayment transaction reprocess — Freo-Money/fineract0 reactions
- Oct 27, 2026CGLT-816: Return a loan from the approval stage to its previous IC level so Prepare and Sign Contract is pending again. — Inkomoko-Dev/fineract-template0 reactions
- Oct 23, 2026Add command to remediate hold/release dates on savings accounts — fiterlatam/fineract-template0 reactions
- Oct 22, 2026Loan charges overpayment reprocess fix — Freo-Money/fineract0 reactions
- Oct 22, 2026CGLT-355: Add Kiva Posting Report with posting status and error details. — Inkomoko-Dev/fineract-template0 reactions
- Oct 14, 2026feat(LMS-155): add savings transaction associated loan functionality — fitercx/fineract0 reactions · 1 comment
- Oct 10, 2026Implement GENESIS banking UAT stack using Fineract, Mifos, ISO 20022 and card/payment processors — hjk-stack/genesis-core-banking0 reactions
- Sep 29, 2026Loan accrual fixes closed before maturity — Freo-Money/fineract0 reactions
- Sep 15, 2026fix(LMS-128): Waive LPI Penalty Not Tax — fitercx/fineract0 reactions · 1 comment
- Sep 3, 2026[feat/common] 배치 운영 모니터링/알림(관리자용) — 관리자 대시보드 대기, 2차 — corebank-tech/corebank-server0 reactions
- Aug 26, 2026Excess parking fixes — Freo-Money/fineract0 reactions
- Aug 26, 2026Oe 32 — fiterinkomoko/fineract-template0 reactions
- Aug 25, 2026feat(LMS-124): reverse standing instruction account transfer transaction — fitercx/fineract0 reactions
- Aug 20, 2026dev-089: validating foreclosure amount configured at product level — Freo-Money/fineract0 reactions
- Aug 14, 2026client npa test — Freo-Money/fineract0 reactions
- Aug 6, 2026part-payment-implementation — Freo-Money/fineract0 reactions
- Jul 28, 2026dev-086: Added accruals for closed loans — Freo-Money/fineract0 reactions
- Jul 7, 2026Feature/refactor journal entry integration — fiterinkomoko/fineract-template0 reactions
- Jul 3, 2026foreclosure changes not considering default values of charge configured at product level — Freo-Money/fineract0 reactions
- Jun 18, 2026Dev undo charge payment — Freo-Money/fineract0 reactions
- Jun 11, 2026undo waive charges and undo waive interest changes — Freo-Money/fineract0 reactions
- May 27, 2026dev-068: Excess payment parking — Freo-Money/fineract0 reactions
- May 22, 2026StringConcatToTextBlock fails for class with @RequiredArgsConstructor — google/error-prone0 reactions · 3 comments
- May 19, 2026dev-066-asynchronise_run_report_backend — Freo-Money/fineract0 reactions
- Mar 18, 2026Cglt 529 — fiterinkomoko/fineract-template0 reactions
- Jan 15, 2026EOA-509: update response — fiterlatam/fineract-template0 reactions
- Aug 24, 2025Thread-safety issue when running Liquibase in a multithreaded and multitenant environment — liquibase/liquibase0 reactions · 4 comments
- May 31, 2025Bulk fix — FintecheandoMX/fineract-ss0 reactions
- Feb 3, 2025Write Generate api client generation script SH Shell script — openMF/fineract-client-kmp0 reactions
- Oct 24, 2024Birthday bank — ryanhu021/fineract0 reactions
- Apr 15, 2024Reading material on double entry accounting — rngadam/bethune-prototype0 reactions
- Mar 9, 2024Birthday dashboard endpoint — nokynokes/fineract0 reactions
- Dec 5, 2023Wealthfront interview — iandavidson/fineract0 reactions
- Sep 29, 2023Add a Classpath Duplicate JAR Detector Unit Test — ohs-foundation/android-fhir0 reactions · 4 comments
- Apr 3, 2023[Bug] unresolvedNamespace prefix appears for standard well known packages — joernio/joern0 reactions
- Apr 3, 2023[Bug] Javasrc error while scanning fineract — joernio/joern0 reactions
- Oct 24, 2022pr — peter-kovacs-dpc/fineract0 reactions
On Hacker News · 2
- Oct 4, 2024Apache Fineract: Open-Source Core Banking for Financial Inclusion5 points
- Jan 30, 2019Apache Fineract2 points · 1 comment
On Stack Overflow · 2
- May 31, 2019Fineract doesn't start in mac Mojave1 vote · 1 answer
- Jul 5, 2025Having troubles deploying app to OpenShift cluster0 votes · 2 answers
In this repositoryOne other file it gives its agents.
- AGENTS.mdAGENTS.md
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

