object.addMetadata(service.getRestMetadataPrefix() + "example-header-2", "example-value");
try {
restS3Service.putObjectWithSignedUrl(signedPutUrl, object);
fail("Should not be able to use a signed URL for an object with changed metadata");
} catch (ServiceException e) {
object.removeMetadata(service.getRestMetadataPrefix() + "example-header-2");
}
// Change the object's name and ensure the signed PUT URL uses the signed name, not the object name.
String originalName = object.getKey();
object.setKey("Testing URL Signing 2");