# v1.5.0

**Release Name**: API Test Commons v1.5.0

**Release Version**: 1.5.0

**Release Date**: 25th March, 2026

### Overview

We are pleased to announce **API Test Commons v1.5.0**, a feature enhancement release that strengthens test data generation, authentication utilities, security handling, and API test infrastructure within the MOSIP Functional Test Framework.

This release introduces centralized ID validation and generation utilities, improved CSRF token management, enhanced authentication utilities, notification and OTP listener enhancements, JWK key management refactoring, and improved REST client capabilities.

Version **1.5.0 builds upon v1.4.1** and continues to improve test automation reliability, security handling, deterministic test data generation, and API execution diagnostics across MOSIP module test suite&#x73;**.**

### Repositories Released

| Repository      | Version                                                                      |
| --------------- | ---------------------------------------------------------------------------- |
| apitest-commons | [v1.5.0](https://github.com/mosip/mosip-functional-tests/tree/release-1.5.x) |

### Bug Fixes

<table><thead><tr><th width="172.90625">JIRA</th><th>Description</th></tr></thead><tbody><tr><td><a href="https://mosip.atlassian.net/browse/MOSIP-44280">MOSIP-44280</a></td><td>Fixed form-data handling so non-string values such as arrays and objects are automatically converted to JSON strings for correct API transmission.</td></tr><tr><td><a href="https://mosip.atlassian.net/browse/MOSIP-44222">MOSIP-44222</a></td><td>Fixed security issue where internal TestNG method names were exposed in reports. Improved scenario grouping and prevented NullPointerExceptions across modules.</td></tr><tr><td><a href="https://mosip.atlassian.net/browse/MOSIP-28574">MOSIP-28574</a></td><td>Improved OTP listener logging, error reporting, and exception handling to prevent unexpected failures and improve execution stability.</td></tr></tbody></table>

### Major Highlights (New Developments & Enhancements)

<table><thead><tr><th width="182.015625">Area</th><th width="145.4375">Key JIRA</th><th>Summary</th></tr></thead><tbody><tr><td>ID Validation &#x26; Test Data Generation</td><td><a href="https://mosip.atlassian.net/browse/MOSIP-33663">MOSIP-33663</a></td><td>Added utilities for generating and validating <strong>UIN, VID, and PRID</strong> identifiers using configurable rules and Verhoeff checksum validation.</td></tr><tr><td>JSON Payload Keyword Support for IDs</td><td><a href="https://mosip.atlassian.net/browse/MOSIP-33663">MOSIP-33663</a></td><td>Added support for dynamic JSON keyword substitutions for valid, invalid, and non-existent identifiers in test payloads.</td></tr><tr><td>CSRF Token Management</td><td><a href="https://mosip.atlassian.net/browse/ES-2739">ES-2739</a></td><td>Added centralized utilities to fetch, extract, store, and reuse CSRF tokens and cookies across API requests.</td></tr><tr><td>REST Client Enhancements</td><td><a href="https://mosip.atlassian.net/browse/MOSIP-31026">MOSIP-31026</a></td><td>Improved REST client capabilities including response header extraction, base64 resource loading, and enhanced response handling for API interactions.</td></tr><tr><td>JWK Key Generation Refactor</td><td><a href="https://mosip.atlassian.net/browse/ES-2836">ES-2836</a></td><td>Refactored JWK generation logic into a centralized reusable method to reduce code duplication and improve maintainability while maintaining backward compatibility.</td></tr><tr><td>JWT Utilities</td><td><a href="https://mosip.atlassian.net/browse/MOSIP-44098">MOSIP-44098</a></td><td>Added utilities for decoding JWT tokens, Base64 URL-safe decoding, and combined header-payload inspection to simplify debugging of authentication flows.</td></tr><tr><td>Authentication Improvements</td><td><a href="https://mosip.atlassian.net/browse/MOSIP-44098">MOSIP-44098</a></td><td>Added role-based Keycloak token retrieval and caching for improved authenticated API execution.</td></tr><tr><td>Bearer Token Support for PATCH Requests</td><td><a href="https://mosip.atlassian.net/browse/MOSIP-44098">MOSIP-44098</a></td><td>Added capability to perform PATCH requests with bearer-token authentication and path parameters.</td></tr><tr><td>Notification &#x26; OTP Listener Enhancements</td><td><a href="https://mosip.atlassian.net/browse/MOSIP-44359">MOSIP-44359</a></td><td>Enhanced notification and OTP listener infrastructure with improved OTP parsing, logging, error handling, and request lifecycle tracking for reliable OTP retrieval in parallel test executions.</td></tr><tr><td>Workflow Message Handling</td><td><a href="https://mosip.atlassian.net/browse/MOSIP-28574">MOSIP-28574</a></td><td>Added workflow message storage and retrieval utilities including capture of additional request identifiers.</td></tr><tr><td>Credential Validation Enhancements</td><td><a href="https://mosip.atlassian.net/browse/MOSIP-41883">MOSIP-41883</a></td><td>Added support to extract credential details for UIN when a specific IDA error scenario occurs, enabling improved validation and reporting.</td></tr><tr><td>Dependency Path Handling</td><td><a href="https://mosip.atlassian.net/browse/MOSIP-44099">MOSIP-44099</a></td><td>Refactored dependency configuration path resolution to support dynamic configuration and improved path robustness.</td></tr><tr><td>Security Improvements</td><td><a href="https://mosip.atlassian.net/browse/MOSIP-28574">MOSIP-28574</a></td><td>Migrated SSL handling from all-trusting configuration to TLS with delegated trust management for improved security.</td></tr><tr><td>PMS DB Placeholder Support</td><td><a href="https://mosip.atlassian.net/browse/MOSIP-44124">MOSIP-44124</a></td><td>Enhanced database test infrastructure to support placeholder substitution in PMS DB scripts.</td></tr><tr><td>Code Quality Improvements</td><td><a href="https://mosip.atlassian.net/browse/MOSIP-28574">MOSIP-28574</a></td><td>Addressed multiple SonarQube findings including improved null handling, logging, exception safety, and removal of redundant code to improve maintainability and reliability.</td></tr></tbody></table>

### Important Usage Update

#### OTP Listener Request Lifecycle

To ensure **accurate OTP/Notification retrieval in parallel executions**, the OTP listener now supports **request lifecycle tracking**.

Consumers of the library should explicitly mark the lifecycle of OTP/Notification requests using the following methods:

* markRequestStart() **before triggering the OTP request**
* markRequestRemove() **after retrieving the OTP**

This allows the OTP listener to correctly associate OTP notifications with:

* execution **thread**
* request **timestamp**
* specific **test context**

This enhancement ensures OTP/Notification values are **accurately captured during parallel test executions**, preventing conflicts between multiple concurrent requests.

#### Example Usage

```
OTPListener.markRequestStart(email);

triggerOtpRequest();

String otp = OTPListener.getOtp(email);

OTPListener.markRequestRemove(email);
```

Using this approach ensures that OTP retrieval is **scoped to the current test execution context**, avoiding incorrect OTP reads when multiple tests run simultaneously.

### **Documentation**

[Setup Guide](https://github.com/mosip/mosip-functional-tests/blob/v1.5.0/README.md)
