From: Aron Roberts Date: Sun, 16 Aug 2009 22:32:17 +0000 (+0000) Subject: CSPACE-324,CSPACE-245: Resolved discrepancy between top-level client ServiceTest... X-Git-Url: https://git.aero2k.de/?a=commitdiff_plain;h=e554491aecf5d74eca027d650f35e2ab5da5add9;p=tmp%2Fjakarta-migration.git CSPACE-324,CSPACE-245: Resolved discrepancy between top-level client ServiceTest and recent changes to the ID Service --- diff --git a/services/client/src/test/java/org/collectionspace/services/client/test/ServiceTest.java b/services/client/src/test/java/org/collectionspace/services/client/test/ServiceTest.java index 2411f3e9d..52f63b5e0 100644 --- a/services/client/src/test/java/org/collectionspace/services/client/test/ServiceTest.java +++ b/services/client/src/test/java/org/collectionspace/services/client/test/ServiceTest.java @@ -27,6 +27,7 @@ import org.apache.commons.httpclient.Header; import org.apache.commons.httpclient.HttpClient; import org.apache.commons.httpclient.HttpException; import org.apache.commons.httpclient.HttpStatus; +import org.apache.commons.httpclient.methods.DeleteMethod; import org.apache.commons.httpclient.methods.GetMethod; import org.apache.commons.httpclient.methods.HeadMethod; import org.apache.commons.httpclient.methods.OptionsMethod; @@ -74,9 +75,9 @@ public class ServiceTest { @Test public void methodNotAllowed() { - //get is not allowed on id service + //delete is not allowed on the root URL of the id service String url = serviceClient.getBaseURL() + "idgenerators"; - GetMethod method = new GetMethod(url); + DeleteMethod method = new DeleteMethod(url); try{ int statusCode = httpClient.executeMethod(method); if(logger.isDebugEnabled()){ diff --git a/services/id/service/src/main/java/org/collectionspace/services/id/IDResource.java b/services/id/service/src/main/java/org/collectionspace/services/id/IDResource.java index f90cfd5e7..56e757dcd 100644 --- a/services/id/service/src/main/java/org/collectionspace/services/id/IDResource.java +++ b/services/id/service/src/main/java/org/collectionspace/services/id/IDResource.java @@ -68,6 +68,30 @@ public class IDResource { // do nothing } + + ////////////////////////////////////////////////////////////////////// + /** + * Placeholder for retrieving list of available ID Generators. + * Currently returns an empty entity body. + * + * Implemented to facilitate a HEAD method test in ServicesTest + * + * @return An empty entity body (for now). + */ + @GET + @Path("") + @Produces("text/plain") + public Response getIDGenerators() { + + logger.debug("> in getIDGenerators()"); + + // @TODO Replace this placeholder code. + Response response = Response.status(Response.Status.NO_CONTENT) + .entity("").type(MediaType.TEXT_PLAIN).build(); + + return response; + } + ////////////////////////////////////////////////////////////////////// /** * Generates and returns a new ID, from the specified ID generator.