}
@Test(groups = "live")
public void testCreateBucket() {
BucketTemplate logTemplate = new BucketTemplate().name(LOG_BUCKET_NAME);
Bucket logResponse = api().createBucket(PROJECT_NUMBER, logTemplate);
assertNotNull(logResponse);
BucketAccessControls acl = BucketAccessControls.builder().bucket(BUCKET_NAME).entity("allUsers").role(Role.OWNER)
.build();
DefaultObjectAccessControls oac = DefaultObjectAccessControls.builder().bucket(BUCKET_NAME).entity("allUsers")
.role(ObjectRole.OWNER).build();
BucketCors bucketCors = BucketCors.builder().addOrigin("http://example.appspot.com").addMethod("GET")
.addMethod("HEAD").addResponseHeader("x-meta-goog-custom").maxAgeSeconds(10).build();
Versioning version = Versioning.builder().enalbled(true).build();
Logging log = Logging.builder().logBucket(LOG_BUCKET_NAME).logObjectPrefix(BUCKET_NAME).build();
BucketTemplate template = new BucketTemplate().name(BUCKET_NAME).addAcl(acl).addDefaultObjectAccessControls(oac)
.versioning(version).location(Location.US_CENTRAL2).logging(log)
.storageClass(StorageClass.DURABLE_REDUCED_AVAILABILITY).addCORS(bucketCors);
Bucket response = api().createBucket(PROJECT_NUMBER, template);