@Test
public void grantPublicSelect() throws Exception {

  underTest.grantPublicSelect(TABLE, "grantor");
  ArgumentCaptor<PrivilegeBag> privilegeBagCaptor = ArgumentCaptor.forClass(PrivilegeBag.class);
  verify(metaStoreClient).grant_privileges(privilegeBagCaptor.capture());
  PrivilegeBag privilegeBag = privilegeBagCaptor.getValue();
  assertThat(privilegeBag.getPrivilegesSize(), is(1));
  HiveObjectPrivilege privilege = privilegeBag.getPrivileges().get(0);
  HiveObjectRef hiveObject = privilege.getHiveObject();
  assertThat(hiveObject.getObjectType(), is(HiveObjectType.TABLE));
  assertThat(hiveObject.getDbName(), is(DATABASE));
  assertThat(hiveObject.getObjectName(), is(TABLE));
  assertThat(hiveObject.getPartValues(), is(nullValue()));
  assertThat(hiveObject.getColumnName(), is(nullValue()));
  assertThat(privilege.getPrincipalName(), is("public"));
  assertThat(privilege.getPrincipalType(), is(ROLE));
  PrivilegeGrantInfo grantInfo = privilege.getGrantInfo();
  assertThat(grantInfo.getPrivilege(), is("SELECT"));
  assertThat(grantInfo.getCreateTime(), is(0));
  assertThat(grantInfo.getGrantor(), is("grantor"));
  assertThat(grantInfo.getGrantorType(), is(ROLE));
  assertThat(grantInfo.isGrantOption(), is(false));
}