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.
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.
? - 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.
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: