Assert.assertEquals(HttpServletResponse.SC_OK, status);
Assert.assertEquals("basic", method.getResponseBodyAsString());
method.releaseConnection();
}
{
PutMethod method = createPutMethod("/locating/basic");
method.setRequestEntity(new StringRequestEntity("basic", "text/plain", null));
int status = client.executeMethod(method);
Assert.assertEquals(204, status);
method.releaseConnection();
}
{
GetMethod method = createGetMethod("/locating/queryParam");
NameValuePair[] params =
{new NameValuePair("param", "hello world")};
method.setQueryString(params);
int status = client.executeMethod(method);
Assert.assertEquals(HttpServletResponse.SC_OK, status);
Assert.assertEquals("hello world", method.getResponseBodyAsString());
method.releaseConnection();
}
{
GetMethod method = createGetMethod("/locating/uriParam/1234");
int status = client.executeMethod(method);
Assert.assertEquals(HttpServletResponse.SC_OK, status);
Assert.assertEquals("1234", method.getResponseBodyAsString());
method.releaseConnection();
}
client.getHttpConnectionManager().closeIdleConnections(0);
dispatcher.getRegistry().removeRegistrations(LocatingResource.class);
Assert.assertEquals(oldSize, dispatcher.getRegistry().getSize());
}