Add unit tests for OpenmrsUtil.isStringInArray#5754
Open
varshithreddybokka4444-netizen wants to merge 2 commits intoopenmrs:masterfrom
Open
Add unit tests for OpenmrsUtil.isStringInArray#5754varshithreddybokka4444-netizen wants to merge 2 commits intoopenmrs:masterfrom
varshithreddybokka4444-netizen wants to merge 2 commits intoopenmrs:masterfrom
Conversation
Author
|
Hi, this is my first contribution to OpenMRS. |
ibacher
reviewed
Feb 6, 2026
| * @see OpenmrsUtil#isStringInArray(String, String[]) | ||
| */ | ||
| @Test | ||
| public void isStringInArray_shouldReturnFalseIfStringIsNull() { |
Member
There was a problem hiding this comment.
Two additional cases to consider:
String[] arr = {"a", null, "b"};
OpenmrsUtil.isStringInArray(null, arr);OpenmrsUtil.isStringInArray(null, null);There was a problem hiding this comment.
Thanks for the suggestion! I’ve added tests to cover both of these cases.
Please let me know if any further adjustments are needed.
|
arvindtelharkar2024
approved these changes
Feb 16, 2026
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.



Description of what I changed
Added unit tests for
OpenmrsUtil.isStringInArrayto cover standard and edge cases, including:These tests document and lock the expected behavior of the utility method.
Issue I worked on
N/A – test-only internal improvement (no JIRA issue required)
Checklist: I completed these to help reviewers :)
My IDE is configured to follow the code style of this project.
I have added tests to cover my changes.
I ran
mvn clean packageright before creating this pull request.Note: The modified tests were run successfully via IntelliJ. Full test suite will be executed by CI.
All new and existing tests passed.
My pull request is based on the latest changes of the master branch.