@Test
public void testPut() throws IOException, SAXException {
WebConversation conv = new WebConversation();
conv.setAuthentication("file", "u1", "p1");
byte[] bytes = new byte[8];
ByteArrayInputStream bais = new ByteArrayInputStream(bytes);
PutMethodWebRequest putRequest = new PutMethodWebRequest(base + "/webresources/myresource", bais, "text/plain");
try {
WebResponse response = conv.getResponse(putRequest);
} catch (HttpException e) {
assertNotNull(e);
assertEquals(403, e.getResponseCode());
return;
}
fail("PUT is not authorized and can still be called");
}