test: add null guard test for purgePatient with null input#6004
Open
CodeWithJatinSh wants to merge 1 commit intoopenmrs:masterfrom
Open
test: add null guard test for purgePatient with null input#6004CodeWithJatinSh wants to merge 1 commit intoopenmrs:masterfrom
CodeWithJatinSh wants to merge 1 commit intoopenmrs:masterfrom
Conversation
|
Kanishka680
reviewed
Mar 31, 2026
Kanishka680
left a comment
There was a problem hiding this comment.
Simple and effective fix. Adding null guards to maintenance methods like purgePatient is a great safety measure.
|
Good addition of a null guard test. It would be helpful to also consider adding a test case that verifies the behavior when a partially null input is provided, to ensure edge cases are covered. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Added a unit test to verify that purgePatient() throws IllegalArgumentException when null is passed. This test documents and protects the null guard behavior added in the related fix PR #5992.