Cosmic Module

O

Qubits of DPK

April 7, 2026

Core Open Source
https://github.com/apache/fineract/pull/5659

Title

FINERACT-2454: Migrate Integration Tests from RestAssured to Feign Client

1. Overview

This PR is part of the FINERACT-2454 integration test modernization effort.
The main goal is to replace RestAssured-based integration tests with the Fineract Feign client.
Instead of manually constructing HTTP requests, tests now use typed API interfaces generated from the Fineract OpenAPI specification.
This improves:
  • maintainability
  • type safety
  • consistency across tests

2. What This PR Changes

This PR migrates existing integration tests that interact with client-related APIs.
The migration replaces:
plain text
QUBITS OF DPK
1RestAssured HTTP calls
with
plain text
QUBITS OF DPK
1Fineract Feign client API calls
This means tests no longer construct raw HTTP requests.

3. Problem in the Old Implementation

Previously tests were written using RestAssured.
Example:
plain text
QUBITS OF DPK
1given()
2.header("Authorization", token)
3.body(request)
4.when()
5.post("/clients")
6.then()
7.statusCode(200);

Problems with this approach

This made integration tests more fragile and harder to maintain.

4. Old Test Flow (RestAssured)

Before the migration, the test architecture looked like this:
plain text
QUBITS OF DPK
1Integration Test
23RestAssured
45Manual HTTP Request
67/clients endpoint
89Fineract REST Controller
Responsibilities handled by the test:
  • HTTP request creation
  • request serialization
  • response parsing
This increased the complexity of integration tests.

5. New Implementation (Feign Client)

After this PR, tests use the Fineract Feign client.
Example:
plain text
QUBITS OF DPK
1ClientsApi clientsApi = client.clientsApi();
2
3clientsApi.createClient(request);
The Feign client automatically:
  • constructs the HTTP request
  • serializes request objects
  • deserializes responses
This simplifies the integration tests.

6. Code Structure Before vs After

Before (RestAssured)

plain text
QUBITS OF DPK
1given()
2.header("Authorization", token)
3.body(request)
4.when()
5.post("/clients")
6.then()
7.statusCode(200);
Characteristics:
  • manual HTTP request
  • string-based endpoints
  • manual JSON handling

After (Feign Client)

plain text
QUBITS OF DPK
1ClientsApi clientsApi = client.clientsApi();
2
3clientsApi.createClient(request);
Characteristics:
  • typed API interface
  • automatic request generation
  • DTO based responses

7. Internal Flow After Migration

plain text
QUBITS OF DPK
1Integration Test
23ClientsApi.createClient()
45Fineract Feign Client
67HTTP POST request generated
89Fineract REST API
The Feign client acts as a typed abstraction layer over the REST API.

8. Benefits of This Change

9. Impact on Fineract Codebase

This PR contributes to the gradual migration of integration tests across the Fineract project.
Benefits include:
  • modern test infrastructure
  • consistent API usage
  • easier debugging and refactoring
This is another step toward completely removing RestAssured from the integration test suite.