use of edu.unc.lib.boxc.model.api.ids.PID in project box-c by UNC-Libraries.
the class PIDsTest method getPidFromRepositoryPathWithWhitespace.
@Test
public void getPidFromRepositoryPathWithWhitespace() {
String path = fakeRepositoryPath(CONTENT_BASE, null);
String paddedPath = " " + path + " ";
PID pid = PIDs.get(path);
assertNotNull(pid);
assertEquals("Identifier did not match provided value", TEST_UUID, pid.getId());
assertEquals("Repository path was incorrect", path, pid.getRepositoryUri().toString());
assertEquals("Incorrect qualifier", CONTENT_BASE, pid.getQualifier());
assertNull("Component path should not be set", pid.getComponentPath());
}
use of edu.unc.lib.boxc.model.api.ids.PID in project box-c by UNC-Libraries.
the class PIDsTest method getContentBaseTest.
@Test
public void getContentBaseTest() {
String path = FEDORA_BASE + CONTENT_BASE;
PID pid = PIDs.get(path);
assertEquals(path, pid.getRepositoryPath());
assertEquals(CONTENT_BASE, pid.getId());
assertEquals(REPOSITORY_ROOT_ID, pid.getQualifier());
}
use of edu.unc.lib.boxc.model.api.ids.PID in project box-c by UNC-Libraries.
the class PIDsTest method getInvalidUUIDPathWithoutHashedContainersTest.
@Test
public void getInvalidUUIDPathWithoutHashedContainersTest() {
String path = FEDORA_BASE + CONTENT_BASE + "/" + TEST_UUID;
PID pid = PIDs.get(path);
assertNull(pid);
}
use of edu.unc.lib.boxc.model.api.ids.PID in project box-c by UNC-Libraries.
the class PIDsTest method getRootTest.
@Test
public void getRootTest() {
String path = FEDORA_BASE;
PID pid = PIDs.get(path);
assertEquals(path, pid.getRepositoryPath());
assertEquals(REPOSITORY_ROOT_ID, pid.getId());
assertEquals(REPOSITORY_ROOT_ID, pid.getQualifier());
}
use of edu.unc.lib.boxc.model.api.ids.PID in project box-c by UNC-Libraries.
the class PIDsTest method getReservedPidFromPathTest.
@Test
public void getReservedPidFromPathTest() {
String qualified = CONTENT_BASE + "/" + CONTENT_ROOT_ID;
String expectedPath = FEDORA_BASE + qualified;
PID pid = PIDs.get(expectedPath);
verifyReservedPid(pid, qualified, expectedPath, null);
}
Aggregations