Skip to content

Commit

Permalink
Fix backup and versions tests to mint unique object ids
Browse files Browse the repository at this point in the history
  • Loading branch information
cbeer committed Nov 7, 2013
1 parent 429082f commit e5d9467
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
Expand Up @@ -17,6 +17,7 @@


import static com.google.common.io.Files.createTempDir;
import static java.util.UUID.randomUUID;
import static org.junit.Assert.assertEquals;

import java.io.File;
Expand All @@ -33,7 +34,7 @@ public class FedoraBackupIT extends AbstractResourceIT {

@Test
public void shouldRoundTripBackups() throws Exception {
final String objName = "objects/FedoraBackupITObject";
final String objName = randomUUID().toString();

// set up the object
final StringBuilder text = new StringBuilder();
Expand Down
Expand Up @@ -17,6 +17,7 @@
package org.fcrepo.integration.http.api;

import static com.hp.hpl.jena.rdf.model.ResourceFactory.createResource;
import static java.util.UUID.randomUUID;
import static org.fcrepo.kernel.RdfLexicon.HAS_PRIMARY_TYPE;
import static org.fcrepo.kernel.RdfLexicon.HAS_VERSION;
import static org.junit.Assert.assertEquals;
Expand Down Expand Up @@ -79,15 +80,17 @@ public void testAddVersion() throws Exception {

@Test
public void testGetDatastreamVersionNotFound() throws Exception {
execute(postObjMethod("FedoraDatastreamsTest1"));

final HttpPost postDs = postDSMethod("FedoraDatastreamsTest1", "ds1", "foo");
execute(postDs);
final String pid = randomUUID().toString();

execute(postObjMethod(pid));

final HttpPost postDs = postDSMethod(pid, "ds1", "foo");
assertEquals(201, getStatus(postDs));

final HttpGet getVersion =
new HttpGet(serverAddress
+ "FedoraDatastreamsTest1/ds1/fcr:versions/lastVersion");
+ pid + "/ds1/fcr:versions/lastVersion");
final HttpResponse resp = execute(getVersion);
assertEquals(404, resp.getStatusLine().getStatusCode());
}
Expand Down

0 comments on commit e5d9467

Please sign in to comment.