InputStream is = getClass().getResourceAsStream( "/artifact.jar" );
// verify that the file exists in resources-dir
assertNotNull( "artifact.jar inputstream", is );
// send request #1 and verify it's successful
WebRequest request = new PutMethodWebRequest( putUrl, is, "application/octet-stream" );
WebResponse response = getServletUnitClient().getResponse( request );
assertResponseCreated( response );
is = getClass().getResourceAsStream( "/artifact.jar.sha1" );
request = new PutMethodWebRequest( checksumUrl, is, "application/octet-stream" );
response = getServletUnitClient().getResponse( request );
assertResponseCreated( response );
is = getClass().getResourceAsStream( "/maven-metadata.xml" );
request = new PutMethodWebRequest( metadataUrl, is, "application/octet-stream" );
response = getServletUnitClient().getResponse( request );
assertResponseCreated( response );
// send request #2 and verify if it's still successful
is = getClass().getResourceAsStream( "/artifact.jar" );
request = new PutMethodWebRequest( putUrl, is, "application/octet-stream" );
response = getServletUnitClient().getResponse( request );
assertResponseNoContent( response );
}