Cosmic Module
O
Qubits of DPK
March 20, 2026
Core Open Source
The Analogy
Integration tests are like a quality inspector at a car factory. Unit tests check individual parts ("does this engine bolt work?"). Integration tests test the whole car driving on a real road ("does the entire system work together?").
Fineract's integration tests start a REAL server, make REAL HTTP calls, hit a REAL database, and verify REAL responses.
Test Infrastructure Overview
javascript
QUBITS OF DPK
How Integration Tests Connect to the Server
java
QUBITS OF DPK
Tests expect a running Fineract server at https://localhost:8443. That's why you ran docker-compose up before running tests.
The Two Client Approaches — Old vs New
OLD WAY — RestAssured (being migrated away from)
java
QUBITS OF DPK
NEW WAY — fineract-client-feign (what your PRs introduce)
java
QUBITS OF DPK
The Feign Client Stack
javascript
QUBITS OF DPK
FineractClientHelper
java
QUBITS OF DPK
Calls.ok()
java
QUBITS OF DPK
The Generated fineract-client
The fineract-client module is auto-generated from the OpenAPI spec during build.
javascript
QUBITS OF DPK
This generates:
- ClientApi.java — all /clients endpoints
- JobsApi.java — all /jobs endpoints
- LoanApi.java — all /loans endpoints
- All request/response model classes (PostClientsRequest, GetClientsClientIdResponse etc.)
You NEVER edit these files manually. They are regenerated every build.
Writing a New Integration Test (The Right Way)
java
QUBITS OF DPK
@ConfigureInstanceMode — JUnit Extension (Your PR #5658)
This is an elegant JUnit 5 pattern:
java
QUBITS OF DPK
Test Helper Pattern — Why Helpers Exist
Instead of every test writing Calls.ok(getFineractClient().clients.createClient(...)), we wrap it in ClientHelper.createClient(). This:
- Reduces code duplication
- Makes tests readable
- When API changes, only update the helper
The migration FINERACT-2441 is converting helpers from RestAssured to feign.