Skip to content

Commit

Permalink
little cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
fasseg committed May 8, 2013
1 parent 5558e04 commit c8aad59
Showing 1 changed file with 4 additions and 6 deletions.
@@ -1,13 +1,13 @@
package org.fcrepo.integration.api;

import static org.junit.Assert.*;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;

import org.apache.commons.io.IOUtils;
import org.apache.http.HttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpPost;
import org.codehaus.jackson.map.ObjectMapper;
import org.codehaus.jettison.json.JSONObject;
import org.fcrepo.Transaction;
import org.fcrepo.Transaction.State;
import org.junit.Test;
Expand All @@ -31,7 +31,6 @@ public void testCreateAndGetTransaction() throws Exception {
HttpGet getTx = new HttpGet(serverAddress + "fcr:tx/" + tx.getId());
resp = execute(getTx);
Transaction fetched = mapper.readValue(resp.getEntity().getContent(), Transaction.class);
/* and parse that one using JSON */
assertEquals(tx.getId(), fetched.getId());
assertEquals(tx.getState(), fetched.getState());
assertEquals(tx.getCreated(), fetched.getCreated());
Expand All @@ -51,10 +50,9 @@ public void testCreateAndCommitTransaction() throws Exception {
assertNotNull(tx.getCreated());
assertTrue(tx.getState() == State.NEW);

/* fetch the create dtx from the endpoint */
/* commit the tx */
HttpPost commitTx = new HttpPost(serverAddress + "fcr:tx/" + tx.getId() + "/fcr:commit");
resp = execute(commitTx);
/* and parse that one using JSON */
Transaction committed = mapper.readValue(resp.getEntity().getContent(), Transaction.class);
assertEquals(committed.getState(), State.COMMITED);
}
Expand Down

0 comments on commit c8aad59

Please sign in to comment.