SwiftStorageProvider extends S3StorageProvider { @Override protected String getNewBucketName(String spaceId) { String truncatedKey = truncateKey(accessKeyId); return S3ProviderUtil.createNewBucketName(truncatedKey, spaceId); } SwiftStorageProvider(String accessKey, String secretKey, Map<String, String> options);  SwiftStorageProvider(AmazonS3 s3Client, String accessKey); @Override StorageProviderType getStorageProviderType(); @Override void removeSpace(String spaceId); @Override String createHiddenSpace(String spaceId, int expirationInDays); ObjectMetadata expireObject(String bucketName, String contentId, Integer seconds);  }
@Test public void testGetNewBucketName() { SwiftStorageProvider provider = new SwiftStorageProvider(accessKey, secretKey, null); String bucketName = provider.getNewBucketName(spaceId); assertEquals(bucketName, truncateKey() + ".spaceid"); }