Skip to content

Commit

Permalink
fixing minting
Browse files Browse the repository at this point in the history
  • Loading branch information
cbeer committed Oct 6, 2014
1 parent 94f3e14 commit 8219ce2
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
Expand Up @@ -626,7 +626,6 @@ private static String getMessage(final Statement stmt) {

private String mintNewPid(final String base, final String slug) {
String pid;
final String newObjectPath;

assertPathExists(base);

Expand All @@ -639,14 +638,9 @@ private String mintNewPid(final String base, final String slug) {
LOGGER.trace("Using external identifier {} to create new resource.", pid);
LOGGER.trace("Using prefixed external identifier {} to create new resource.", uriInfo.getBaseUri() + "/"
+ pid);
String basePath = base.substring(1);

if (!basePath.isEmpty()) {
basePath += "/";
}

final URI path1 = uriInfo.getAbsolutePathBuilder().clone().path(FedoraLdp.class)
.resolveTemplate("path", basePath + pid, false).build();
.resolveTemplate("path", pid, false).build();

pid = translator().asString(createResource(path1.toString()));
try {
Expand Down
Expand Up @@ -746,6 +746,20 @@ public void testIngestWithBinary() throws Exception {
getStatus(new HttpGet(location)));
}

@Test
public void testIngestOnSubtree() throws Exception {
final String pid = getRandomUniquePid();
createObject(pid);


final HttpPost method = postObjMethod(pid);
method.addHeader("Slug", "x");
final HttpResponse response = client.execute(method);
final String location = response.getFirstHeader("Location").getValue();
assertEquals(serverAddress + pid + "/x", location);

}

@Test
public void testCreateManyObjects() throws Exception {
if (System.getProperty(TEST_ACTIVATION_PROPERTY) == null) {
Expand Down

0 comments on commit 8219ce2

Please sign in to comment.