@Test
public void testInsertBucket() throws Exception {

  Bucket bucket = new Bucket().setName(BUCKET_NAME);
  Storage.Buckets.Insert insert =
      newStorage().buckets().insert(BUCKET_NAME, bucket).setProject(PROJECT);
  StorageRequestAuthorizer authorizer = new StorageRequestAuthorizer(mockHandler);
  authorizer.authorize(insert);
  ArgumentCaptor<String> projectCaptor = ArgumentCaptor.forClass(String.class);
  ArgumentCaptor<URI> captor = ArgumentCaptor.forClass(URI.class);
  verify(mockHandler).handleInsertBucket(projectCaptor.capture(), captor.capture());
  assertThat(projectCaptor.getValue()).isEqualTo(PROJECT);
  assertThat(captor.getValue().getAuthority()).isEqualTo(BUCKET_NAME);
  assertThat(captor.getValue().getPath()).isEqualTo("/");
}