Source:
public AmbryBlobStorageServiceTest() throws Exception { accountService.clear(); RestRequestMetricsTracker.setDefaults(metricRegistry); configProps.setProperty("frontend.allow.service.id.based.post.request", String.valueOf(shouldAllowServiceIdBasedPut)); configProps.setProperty("router.hostname", "localhost"); configProps.setProperty("router.datacenter.name", "localDC"); verifiableProperties = new VerifiableProperties(configProps); frontendConfig = new FrontendConfig(verifiableProperties); urlSigningService = new AmbryUrlSigningService(frontendConfig.frontendUrlSignerUploadEndpoint, frontendConfig.frontendUrlSignerDownloadEndpoint, frontendConfig.frontendUrlSignerDefaultUrlTtlSecs, frontendConfig.frontendUrlSignerDefaultMaxUploadSizeBytes, frontendConfig.frontendUrlSignerMaxUrlTtlSecs, SystemTime.getInstance()); idConverterFactory = new AmbryIdConverterFactory(verifiableProperties, metricRegistry); securityServiceFactory = new AmbrySecurityServiceFactory(verifiableProperties, metricRegistry, null, urlSigningService); refAccount = accountService.createAndAddRandomAccount(); for (Container container : refAccount.getAllContainers()) { if (container.getId() == Container.DEFAULT_PUBLIC_CONTAINER_ID) { refDefaultPublicContainer = container; } else if (container.getId() == Container.DEFAULT_PRIVATE_CONTAINER_ID) { refDefaultPrivateContainer = container; } else { refContainer = container; } } clusterMap = new MockClusterMap(); blobIdVersion = CommonTestUtils.getCurrentBlobIdVersion(); router = new InMemoryRouter(verifiableProperties, clusterMap); responseHandler = new FrontendTestResponseHandler(); referenceBlobId = new BlobId(blobIdVersion, BlobId.BlobIdType.NATIVE, ClusterMapUtils.UNKNOWN_DATACENTER_ID, Account.UNKNOWN_ACCOUNT_ID, Container.UNKNOWN_CONTAINER_ID, clusterMap.getWritablePartitionIds().get(0)); referenceBlobIdStr = referenceBlobId.getID(); ambryBlobStorageService = getAmbryBlobStorageService(); responseHandler.start(); ambryBlobStorageService.start(); }

Target:
public AmbryBlobStorageServiceTest() throws Exception { RestRequestMetricsTracker.setDefaults(metricRegistry); configProps.setProperty("frontend.allow.service.id.based.post.request", String.valueOf(shouldAllowServiceIdBasedPut)); verifiableProperties = new VerifiableProperties(configProps); frontendConfig = new FrontendConfig(verifiableProperties); urlSigningService = new AmbryUrlSigningService(frontendConfig.frontendUrlSignerUploadEndpoint, frontendConfig.frontendUrlSignerDownloadEndpoint, frontendConfig.frontendUrlSignerDefaultUrlTtlSecs, frontendConfig.frontendUrlSignerDefaultMaxUploadSizeBytes, frontendConfig.frontendUrlSignerMaxUrlTtlSecs, SystemTime.getInstance()); idConverterFactory = new AmbryIdConverterFactory(verifiableProperties, metricRegistry); securityServiceFactory = new AmbrySecurityServiceFactory(verifiableProperties, metricRegistry, null, urlSigningService); clusterMap = new MockClusterMap(); accountService.clear(); refAccount = accountService.createAndAddRandomAccount(); for (Container container : refAccount.getAllContainers()) { if (container.getId() == Container.DEFAULT_PUBLIC_CONTAINER_ID) { refDefaultPublicContainer = container; } else if (container.getId() == Container.DEFAULT_PRIVATE_CONTAINER_ID) { refDefaultPrivateContainer = container; } else { refContainer = container; } } blobIdVersion = CommonTestUtils.getCurrentBlobIdVersion(); router = new InMemoryRouter(verifiableProperties, clusterMap); responseHandler = new FrontendTestResponseHandler(); referenceBlobId = new BlobId(blobIdVersion, BlobId.BlobIdType.NATIVE, ClusterMapUtils.UNKNOWN_DATACENTER_ID, Account.UNKNOWN_ACCOUNT_ID, Container.UNKNOWN_CONTAINER_ID, clusterMap.getWritablePartitionIds().get(0)); referenceBlobIdStr = referenceBlobId.getID(); ambryBlobStorageService = getAmbryBlobStorageService(); responseHandler.start(); ambryBlobStorageService.start(); }