Skip to content

MOSIP- 44419: Removed reflection-based TestNG method name modification.#1683

Merged
Prafulrakhade merged 1 commit intomosip:developfrom
SradhaMohanty5899:MOSIP-44419
Feb 16, 2026
Merged

MOSIP- 44419: Removed reflection-based TestNG method name modification.#1683
Prafulrakhade merged 1 commit intomosip:developfrom
SradhaMohanty5899:MOSIP-44419

Conversation

@SradhaMohanty5899
Copy link
Contributor

@SradhaMohanty5899 SradhaMohanty5899 commented Feb 13, 2026

MOSIP- 44419: Removed reflection-based TestNG method name modification.

Summary by CodeRabbit

Release Notes

  • Refactor

    • Enhanced test result tracking with a more reliable and maintainable approach across test scripts.
  • Chores

    • Updated API test commons dependency to version 1.5.0-SNAPSHOT.

Signed-off-by: SradhaMohanty5899 <mohantysradha10@gmail.com>
@coderabbitai
Copy link

coderabbitai bot commented Feb 13, 2026

Walkthrough

Updated a dependency version in the build configuration, then refactored 21 test script files to replace reflection-based TestNG result field manipulation with direct attribute assignments, eliminating reflection logic and exception handling across AfterMethod hooks.

Changes

Cohort / File(s) Summary
Dependency Update
api-test/pom.xml
Updated apitest-commons dependency version from 1.4.0-SNAPSHOT to 1.5.0-SNAPSHOT.
Test Script Refactoring
api-test/src/main/java/io/mosip/testrig/apirig/auth/testscripts/AddIdentity.java, BioAuth.java, DemoAuth.java, DemoAuthSimplePostForAutoGenId.java, GetWithParam.java, GetWithParamForAutoGenId.java, KycExchange.java, MultiFactorAuthNew.java, OtpAuthNew.java, PatchWithBodyWithOtpGenerate.java, PostWithAutogenIdWithOtpGenerate.java, PostWithBodyAndQueryParamsForAutoGenId.java, PostWithBodyWithOtpGenerate.java, PostWithOnlyPathParam.java, PutWithPathParamsAndBody.java, SimplePatchForAutoGenId.java, SimplePost.java, SimplePostForAutoGenId.java, UpdateDraft.java, UpdateIdentity.java
Replaced reflective manipulation of TestNG internal fields (m\_method, m\_methodName) with straightforward result.setAttribute("TestCaseName", testCaseName) calls in AfterMethod hooks. Removes reflection-based field access, exception handling, and Reporter logging while preserving functionality through attribute storage.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 Reflection's gone, no more tricks we play,
Attributes now hold the test's true name,
Twenty files simplified in one swift way,
TestNG results freed from reflection's game!

🚥 Pre-merge checks | ✅ 3 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 73.08% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change across all modified files: replacing reflection-based TestNG method name manipulation with attribute assignment.
Merge Conflict Detection ✅ Passed ✅ No merge conflicts detected when merging into develop

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

No actionable comments were generated in the recent review. 🎉


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@Prafulrakhade Prafulrakhade merged commit 9d9d464 into mosip:develop Feb 16, 2026
17 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.

4 participants