Skip to content

Corrected decommissionRegCenterFail_WithMappedRegCenter testcase [MOSIP-44916]#1354

Merged
dhanendra06 merged 3 commits intomosip:developfrom
GOKULRAJ136:dev-test8582
Apr 27, 2026
Merged

Corrected decommissionRegCenterFail_WithMappedRegCenter testcase [MOSIP-44916]#1354
dhanendra06 merged 3 commits intomosip:developfrom
GOKULRAJ136:dev-test8582

Conversation

@GOKULRAJ136
Copy link
Copy Markdown
Contributor

@GOKULRAJ136 GOKULRAJ136 commented Apr 27, 2026

Summary by CodeRabbit

  • Tests
    • Re-enabled a previously disabled test for registration center decommissioning to improve coverage.
    • Added a test setup step to ensure a controlled database state before running the test.
    • Preserved existing expected error-response validation to maintain consistent verification of mapped registration-center behavior.

…IP-44916]

Signed-off-by: GOKULRAJ136 <110164849+GOKULRAJ136@users.noreply.github.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 27, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 8de6e46b-8038-4c62-b327-1a6b14369275

📥 Commits

Reviewing files that changed from the base of the PR and between ce601d8 and b7be2af.

📒 Files selected for processing (1)
  • admin/kernel-masterdata-service/src/test/java/io/mosip/kernel/masterdata/test/controller/RegistrationCenterControllerTest.java

Walkthrough

Un-ignores a previously skipped test for decommissioning a registration center and adds a SQL setup step that deletes master.user_detail rows for regcntr_id='10003' before the test, keeping the existing assertion that expects error code KER-MSD-351.

Changes

Cohort / File(s) Summary
Registration Center Test
admin/kernel-masterdata-service/src/test/java/io/mosip/kernel/masterdata/test/controller/RegistrationCenterControllerTest.java
Removes @Ignore from decommissionRegCenterFail_WithMappedRegCenter and adds an @Sql BEFORE_TEST_METHOD to delete master.user_detail rows for regcntr_id='10003'; retains existing assertion expecting KER-MSD-351 in the response.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐰 A sleepy test I nudged awake,
Cleared the rows so flakiness won't break.
No longer ignored, it checks once more,
For KER-MSD-351 — the code we swore.
Hopping happy, the green run I take!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically identifies the main change: correcting a previously ignored test case by adding necessary database setup, making it directly related to the changeset.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In
`@admin/kernel-masterdata-service/src/test/java/io/mosip/kernel/masterdata/test/controller/RegistrationCenterControllerTest.java`:
- Around line 516-528: The test decommissionRegCenterFail_WithMappedRegCenter is
too permissive: the service method decommissionRegCenter
(RegistrationCenterServiceImpl) deterministically checks users first and for
regcenterID=10003 will always return KER-MSD-352 (MAPPED_TO_USER), so replace
the OR substring assertion with a strict check for KER-MSD-352 using the project
helper and an explicit HTTP status assertion; specifically update
decommissionRegCenterFail_WithMappedRegCenter to use
MasterDataTest.checkResponse(result, "KER-MSD-352") (or equivalent helper) and
assert the HTTP response status is the expected error status (e.g., 400) instead
of using body.contains("KER-MSD-351") || body.contains("KER-MSD-352").
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 4ca013e3-b5d9-4a75-a313-a6b2c28cb0b4

📥 Commits

Reviewing files that changed from the base of the PR and between 34213c4 and ce601d8.

📒 Files selected for processing (1)
  • admin/kernel-masterdata-service/src/test/java/io/mosip/kernel/masterdata/test/controller/RegistrationCenterControllerTest.java

Signed-off-by: GOKULRAJ136 <110164849+GOKULRAJ136@users.noreply.github.com>
Signed-off-by: GOKULRAJ136 <110164849+GOKULRAJ136@users.noreply.github.com>
@dhanendra06 dhanendra06 merged commit 5f4931a into mosip:develop Apr 27, 2026
20 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.

2 participants