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;
@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()){
// 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.