}
protected static AssetInfo setupAssetWithFile() throws ServiceException {
String name = UUID.randomUUID().toString();
String testBlobName = "test" + name + ".bin";
AssetInfo assetInfo = service.create(Asset.create().setName(
testAssetPrefix + name));
AccessPolicyInfo accessPolicyInfo = service.create(AccessPolicy.create(
testPolicyPrefix + name, 10,
EnumSet.of(AccessPolicyPermission.WRITE)));
LocatorInfo locator = createLocator(accessPolicyInfo, assetInfo, 5);
WritableBlobContainerContract blobWriter = service
.createBlobWriter(locator);
InputStream blobContent = new ByteArrayInputStream(new byte[] { 4, 8,
15, 16, 23, 42 });
blobWriter.createBlockBlob(testBlobName, blobContent);
service.action(AssetFile.createFileInfos(assetInfo.getId()));
return assetInfo;
}