]> git.aero2k.de Git - tmp/jakarta-migration.git/commitdiff
CSPACE-324,CSPACE-245: Resolved discrepancy between top-level client ServiceTest...
authorAron Roberts <aron@socrates.berkeley.edu>
Sun, 16 Aug 2009 22:32:17 +0000 (22:32 +0000)
committerAron Roberts <aron@socrates.berkeley.edu>
Sun, 16 Aug 2009 22:32:17 +0000 (22:32 +0000)
services/client/src/test/java/org/collectionspace/services/client/test/ServiceTest.java
services/id/service/src/main/java/org/collectionspace/services/id/IDResource.java

index 2411f3e9d0d17faa346d4dce8b8df39fa8769790..52f63b5e0cf49d72ea98f4c1be55e58a3000aac0 100644 (file)
@@ -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()){
index f90cfd5e7a8143ecc968a931bcf8a5d9c8c17a42..56e757dcd8f2dba0eb3275322959a7c13eb2e728 100644 (file)
@@ -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.