-
Notifications
You must be signed in to change notification settings - Fork 531
IQSS/11592-Fix Handle case insensitivity broken in 6.5 #11742
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IQSS/11592-Fix Handle case insensitivity broken in 6.5 #11742
Conversation
| assertEquals(pid1String, pid3.asString()); | ||
| assertEquals("hdl1", pid3.getProviderId()); | ||
|
|
||
| // Test case sensitivity - a handle with uppercase "TEST" should not match the hdl1 provider |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comment leads me to believe you will be comparing the uppercase "TEST" of pid4 to the lowercase "test" in pid1String showing they are not equal.
Maybe add:
assertNotEquals(pid4.asString(), pid1String);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
? - this test has nothing to do with pid1 other than all 4 tests use the hdl1 provider defined around line 110. Line 110 itself defines the hdl1 provider as having the lower case 'test' shoulder, so hdl4 which uses upper case won't match it. In this case, pid4String should still be recognized as a Handle, so the assertEquals on 311 should work (the string form of the pid equals the original string), but it won't be recognized by the hdl1 provider, only the UnmanagedHandlePidProvider (tested on line 312).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My point was there should be a negative test showing that "test" isn't equal to "TEST"
|
Tests are passing - no issues found. Going to merge. |
What this PR does / why we need it: Prior changes to make DOIs fully case insensitive had a bug that also made Handles (which are case sensitive) fail PID recognition when the shoulder is specified as lower case. This PR corrects the bug to only use a toUpperCase() on the shoulder for case-insensitive PID types. It also updates the tests to use a non-empty Handle shoulder and verify that comparisons are case sensitive.
Which issue(s) this PR closes:
Special notes for your reviewer:
Suggestions on how to test this: Since we don't have a Handle setup, rely on the unit test, regression test. The submitter of the issue may be able to test the fix as well.
Does this PR introduce a user interface change? If mockups are available, please link/include them here:
Is there a release notes update needed for this change?: inc.
Additional documentation: