use of com.google.cloud.bigquery.Acl.View in project google-cloud-java by GoogleCloudPlatform.
the class AclTest method testOf.
@Test
public void testOf() {
Acl acl = Acl.of(Group.ofAllAuthenticatedUsers(), Role.READER);
assertEquals(Group.ofAllAuthenticatedUsers(), acl.getEntity());
assertEquals(Role.READER, acl.getRole());
Dataset.Access pb = acl.toPb();
assertEquals(acl, Acl.fromPb(pb));
View view = new View(TableId.of("project", "dataset", "view"));
acl = Acl.of(view);
assertEquals(view, acl.getEntity());
assertEquals(null, acl.getRole());
}
use of com.google.cloud.bigquery.Acl.View in project google-cloud-java by GoogleCloudPlatform.
the class AclTest method testViewEntity.
@Test
public void testViewEntity() {
TableId viewId = TableId.of("project", "dataset", "view");
View entity = new View(viewId);
assertEquals(viewId, entity.getId());
assertEquals(Type.VIEW, entity.getType());
Dataset.Access pb = entity.toPb();
assertEquals(entity, Entity.fromPb(pb));
}