ObjectApi srcApi = api.getObjectApiForRegionAndContainer(regionId, sourceContainer);
ObjectApi destApi = api.getObjectApiForRegionAndContainer(regionId, destinationContainer);
// Create source object
assertNotNull(srcApi.put(sourceObjectName, PAYLOAD));
SwiftObject sourceObject = srcApi.get(sourceObjectName);
checkObject(sourceObject);
// Create the destination object
assertNotNull(destApi.put(destinationObject, PAYLOAD));
SwiftObject object = destApi.get(destinationObject);
checkObject(object);
// check the copy operation
assertTrue(destApi.copy(destinationObject, sourceContainer, sourceObjectName));
assertNotNull(destApi.get(destinationObject));
// now get a real SwiftObject
SwiftObject destSwiftObject = destApi.get(destinationObject);
assertEquals(toStringAndClose(destSwiftObject.getPayload().openStream()), "swifty");
// test exception thrown on bad source name
try {
destApi.copy(destinationObject, badSource, sourceObjectName);
fail("Expected CopyObjectException");