-
Notifications
You must be signed in to change notification settings - Fork 122
Open
Description
KeySpaceUtils.pathToUri inserts extra / when path ends with NULL.
I created the following test:
@Test
void nullAtEnd() throws RelationalException {
KeySpace keySpace = new KeySpace(
createDirectory("null", KeySpaceDirectory.KeyType.NULL, true, null),
createDirectory("parent", KeySpaceDirectory.KeyType.STRING, true, "parent")
.addSubdirectory(createDirectory("null", KeySpaceDirectory.KeyType.NULL, true, null)));
URI rootUrl = URI.create("/");
final KeySpacePath rootPath = keySpace.path("null");
URI url = URI.create("/parent/");
final KeySpacePath path = keySpace.path("parent").add("null");
Assertions.assertAll(
() -> Assertions.assertEquals(rootPath, KeySpaceUtils.toKeySpacePath(rootUrl, keySpace)),
() -> Assertions.assertEquals(rootUrl, KeySpaceUtils.pathToUri(rootPath)),
() -> Assertions.assertEquals(path, KeySpaceUtils.toKeySpacePath(url, keySpace)),
() -> Assertions.assertEquals(url, KeySpaceUtils.pathToUri(path)));
}
And it fails because the root produces // and the non-root produces /parent//.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels