Skip to content

AUDIT-26: Exclude abstract classes from audited entity validation#41

Open
shlok612 wants to merge 2 commits intoopenmrs:mainfrom
shlok612:main
Open

AUDIT-26: Exclude abstract classes from audited entity validation#41
shlok612 wants to merge 2 commits intoopenmrs:mainfrom
shlok612:main

Conversation

@shlok612
Copy link
Copy Markdown

🛠️ Description

This PR fixes AUDIT-26 by excluding abstract and base classes from the audited entity validation logic.

❌ Problem

Abstract classes like BaseOpenmrsData and BaseOpenmrsMetadata were being included in the entity selection dropdown. These classes are not audited, leading to NotAuditedException at runtime.

✅ Solution

Added a filter to exclude abstract classes using Modifier.isAbstract() during validation.

🔍 Changes

  • Added filter to remove abstract classes from the entity list
  • Prevents invalid entity selection and runtime errors

📌 Impact

  • Fixes dropdown issue
  • Prevents application crashes
  • Ensures only valid audited entities are processed

@shubhangiisinghh
Copy link
Copy Markdown

Could we add a test case that confirms abstract classes are filtered out ?
There is no test added probably. A unit test that verifies abstract classes would make this PR complete I feel.

@shlok612
Copy link
Copy Markdown
Author

Could we add a test case that confirms abstract classes are filtered out ? There is no test added probably. A unit test that verifies abstract classes would make this PR complete I feel.

Thanks for the suggestion! I’ll add a unit test to verify that abstract classes are excluded from entity validation.

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