File parent = null;
try {
parent = createDirectory();
Date earliest = TUtilsDate.getNowWithoutMillis();
Date latest = TUtilsDate.getLaterDate(earliest);
Bucket bucketWithTimes = TUtilsBucket.createBucketInDirectoryWithTimes(
parent, earliest, latest);
long latestInSeconds = latest.getTime() / 1000;
long earliestInSeconds = earliest.getTime() / 1000;
String expectedBucketNameStart = "db_" + latestInSeconds + "_"
+ earliestInSeconds;
assertTrue(bucketWithTimes.getName().startsWith(expectedBucketNameStart));
} finally {
FileUtils.deleteQuietly(parent);
}
}