@Test(groups = { "functional" })
public void _givenTgzConfig_thawsTgzBucketToSplunkBucket()
throws IllegalIndexException {
File thawDir = createDirectory();
Bucket bucket = getTgzBucketArchived();
SplunkIndexesLayer splunkIndexesLayer = new FakeSplunkIndexesLayer(thawDir);
BucketThawer bucketThawer = BucketThawerFactory
.createWithConfigAndSplunkSettingsAndLocalFileSystemPaths(tgzConf,
splunkIndexesLayer, localFileSystemPaths);
bucketThawer.thawBuckets(bucket.getIndex(), bucket.getEarliest(),
bucket.getLatest());
List<LocalBucket> buckets = bucketThawer.getThawedBuckets();
assertEquals(1, buckets.size());
Bucket thawedBucket = buckets.get(0);
File thawedBucketDir = new File(thawedBucket.getPath());
assertTrue(thawedBucketDir.isDirectory());
assertTrue(thawedBucketDir.exists());
assertEquals(BucketFormat.SPLUNK_BUCKET, thawedBucket.getFormat());
assertEquals(thawDir.getAbsolutePath(), thawedBucketDir.getParentFile()
.getAbsolutePath());
int length = thawedBucketDir.listFiles().length;
assertTrue(2 < length);
}