public void testPurgeObject() throws Exception {
for (String regionId : regions) {
String objectName = "testPurge";
Payload payload = Payloads.newByteSourcePayload(ByteSource.wrap(new byte[] {1, 2, 3}));
ObjectApi objectApi = api.getObjectApiForRegionAndContainer(regionId, name);
// create a new object
objectApi.put(objectName, payload);
CDNApi cdnApi = api.getCDNApiForRegion(regionId);
assertTrue(cdnApi.purgeObject(name, "testPurge", ImmutableList.<String>of()));
// delete the object
objectApi.delete(objectName);
assertNull(objectApi.get(objectName, GetOptions.NONE));
}
}