Skip to content

Commit

Permalink
adds jersey-json dependency with version management in the parent pom
Browse files Browse the repository at this point in the history
adds integration test for JSON at the describe endpoint
  • Loading branch information
gregjan committed Apr 25, 2013
1 parent 06d4946 commit ad75ee4
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 1 deletion.
6 changes: 5 additions & 1 deletion fcrepo-http-api/pom.xml
Expand Up @@ -42,7 +42,11 @@
<dependency>
<groupId>com.sun.jersey</groupId>
<artifactId>jersey-core</artifactId>
</dependency>
</dependency>
<dependency>
<groupId>com.sun.jersey</groupId>
<artifactId>jersey-json</artifactId>
</dependency>
<dependency>
<groupId>com.yammer.metrics</groupId>
<artifactId>metrics-jersey</artifactId>
Expand Down
Expand Up @@ -3,6 +3,7 @@

import static java.util.regex.Pattern.DOTALL;
import static java.util.regex.Pattern.compile;
import static javax.ws.rs.core.MediaType.APPLICATION_JSON;
import static javax.ws.rs.core.MediaType.TEXT_XML;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
Expand Down Expand Up @@ -40,6 +41,19 @@ public void testDescribe() throws Exception {
description).find());
}

@Test
public void testDescribeJSON() throws Exception {
final HttpGet method = new HttpGet(serverAddress + "describe");
method.addHeader("Accept", APPLICATION_JSON);
final HttpResponse response = client.execute(method);
assertEquals(200, response.getStatusLine().getStatusCode());
final String description = EntityUtils.toString(response.getEntity());
logger.debug("HERE WE ARE: Found the repository description:\n" + description);
assertTrue("Failed to find a proper repo version", compile(
"\"repositoryVersion\"\\s*:\\s*\".*\"").matcher(
description).find());
}

@Test
public void testDescribeHtml() throws Exception {
final HttpGet method = new HttpGet(serverAddress + "describe");
Expand Down
5 changes: 5 additions & 0 deletions pom.xml
Expand Up @@ -206,6 +206,11 @@
<artifactId>jersey-spring</artifactId>
<version>${jersey.version}</version>
</dependency>
<dependency>
<groupId>com.sun.jersey</groupId>
<artifactId>jersey-json</artifactId>
<version>${jersey.version}</version>
</dependency>

<!-- sesame/openrdf dependencies that were previously provided by the Aduna
Maven repo -->
Expand Down

0 comments on commit ad75ee4

Please sign in to comment.