method.setRequestEntity(requestentity);
UsernamePasswordCredentials creds =
new UsernamePasswordCredentials("testuser", "testpass");
HttpRequestHandlerChain handlerchain = new HttpRequestHandlerChain();
handlerchain.appendHandler(new AuthRequestHandler(creds));
handlerchain.appendHandler(new HttpServiceHandler(new EchoService()));
this.server.setRequestHandler(handlerchain);
this.client.getState().setCredentials(AuthScope.ANY, creds);
try {
this.client.executeMethod(method);
assertEquals(200, method.getStatusCode());