MockObjectListing.simfilter = false;
MockAmazonS3Client.bucketName = "RESTOREBUCKET";
MockAmazonS3Client.prefix = "test_restore_backup/fake-restore-region/fakerestorecluster" + "/" + factory.getInstance().getToken();
MockAmazonS3Client.prefix += "/20110811";
S3FileIterator fileIterator = new S3FileIterator(injector.getProvider(AbstractBackupPath.class), s3client, "RESTOREBUCKET/test_restore_backup/fake-restore-region/fakerestorecluster", startTime, endTime);
Set<String> files = new HashSet<String>();
while (fileIterator.hasNext())
files.add(fileIterator.next().getRemotePath());
while (fileIterator.hasNext())
files.add(fileIterator.next().getRemotePath());
Assert.assertEquals(5, files.size());
Assert.assertTrue(files.contains("test_backup/"+FakeConfiguration.FAKE_REGION+"/fakecluster/123456/201108110030/SNAP/ks1/cf1/f1.db"));
Assert.assertTrue(files.contains("test_backup/"+FakeConfiguration.FAKE_REGION+"/fakecluster/123456/201108110430/SST/ks1/cf1/f2.db"));
Assert.assertTrue(files.contains("test_backup/"+FakeConfiguration.FAKE_REGION+"/fakecluster/123456/201108110030/META/meta.json"));