TestCredentialsProvider credsProvider = new TestCredentialsProvider(
new UsernamePasswordCredentials("test", "test"));
this.httpclient.setCredentialsProvider(credsProvider);
HttpPut httpput = new HttpPut("/");
NByteArrayEntity entity = new NByteArrayEntity(new byte[] { 1, 2, 3, 4, 5, 6, 7, 8, 9 }) {
@Override
public boolean isRepeatable() {
return false;
}
};
httpput.setEntity(entity);
httpput.getParams().setBooleanParameter(CoreProtocolPNames.USE_EXPECT_CONTINUE, true);
Future<HttpResponse> future = this.httpclient.execute(target, httpput, null);
HttpResponse response = future.get();
Assert.assertNotNull(response);
Assert.assertEquals(HttpStatus.SC_OK, response.getStatusLine().getStatusCode());