Skip to content

Add test for unbounded lower bound in DoubleRange.contains()#5988

Open
RujataGaikwad wants to merge 3 commits intoopenmrs:masterfrom
RujataGaikwad:master
Open

Add test for unbounded lower bound in DoubleRange.contains()#5988
RujataGaikwad wants to merge 3 commits intoopenmrs:masterfrom
RujataGaikwad:master

Conversation

@RujataGaikwad
Copy link
Copy Markdown

@RujataGaikwad RujataGaikwad commented Mar 29, 2026

This PR adds a unit test to verify the behavior of DoubleRange.contains() when the lower bound is unbounded (null) and the upper bound is unbounded (null).

What this test covers

  • Ensures that values within the valid range are correctly identified when the lower bound is not defined.
  • Ensures correct behavior when the upper bound is unbounded (null).
  • Improves test coverage for edge cases involving unbounded ranges.

Why this is important

Handling unbounded ranges correctly is critical for ensuring that the DoubleRange utility behaves reliably in all scenarios.

Notes

  • I attempted to create a Jira ticket, but was unable to access or create one due to technical issues with the Jira system, so I am proceeding with this PR directly to improve test coverage.
  • I have followed the project’s coding standards and ensured all tests pass successfully.

Checklist

✔ Code follows project style
✔ Added relevant test case
✔ All tests pass (mvn clean package)
✔ Based on latest master branch

@Chinmay7070
Copy link
Copy Markdown
Contributor

Can you please mention the ticket in the PR? It helps keep things clear and easier to track.

@RujataGaikwad
Copy link
Copy Markdown
Author

Can you please mention the ticket in the PR? It helps keep things clear and easier to track.

Thank you for the feedback. I will create a JIRA ticket and update the PR title and description to include the ticket reference and clarify the purpose of the test.

Please let me know if any further changes are required.

@RujataGaikwad
Copy link
Copy Markdown
Author

Also raise a ticket before create a PR for an issue on jira and in pr describe what your Junit test is for the PR title should contain ticket number TUNK-{ticketNumber} : Issue

Thank you for the suggestion. I attempted to create a JIRA ticket, but the issue creation page keeps loading and does not allow me to proceed. Please let me know how I should proceed.

@RujataGaikwad RujataGaikwad changed the title Add test for unbounded lower bound in DoubleRange.contains TRUNK-6601: Add test for unbounded lower bound in DoubleRange.contains() Mar 30, 2026
@RujataGaikwad RujataGaikwad changed the title TRUNK-6601: Add test for unbounded lower bound in DoubleRange.contains() Add test for unbounded lower bound in DoubleRange.contains() Mar 30, 2026
Copy link
Copy Markdown

@fierce-adventurer fierce-adventurer left a comment

Choose a reason for hiding this comment

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

Also raise a ticket before create a PR for an issue on jira and in pr describe what your Junit test is for the PR title should contain ticket number
TUNK-{ticketNumber} : Issue

@RujataGaikwad
Copy link
Copy Markdown
Author

Also raise a ticket before create a PR for an issue on jira and in pr describe what your Junit test is for the PR title should contain ticket number TUNK-{ticketNumber} : Issue

I was unable to create a Jira ticket due to access/technical issues. I have updated the PR title and added a description explaining the purpose of the test.

Could you please guide me on how I can get access to create Jira tickets or what I should do in this case?

@sonarqubecloud
Copy link
Copy Markdown

Copy link
Copy Markdown
Author

@RujataGaikwad RujataGaikwad left a comment

Choose a reason for hiding this comment

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

Nice work on adding the test for DoubleRange.contains() with the upper bound case.
The test looks clear and follows proper structure. 👍
Approving the changes

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.

3 participants