@Test(expected=SentryNoSuchObjectException.class) public void testDropNotExistRole() throws Exception { String roleName = "not-exist"; String grantor = "grantor"; sentryStore.dropRole(SEARCH, roleName, grantor); }
@Test(expected=SentryNoSuchObjectException.class) public void testDropNotExistRole() throws Exception { String roleName = "not-exist"; String grantor = "grantor"; sentryStore.dropRole(SEARCH, roleName, grantor); }
@Test public void testCreateDropRole() throws Exception { String roleName = "test-drop-role"; String grantor = "grantor"; sentryStore.createRole(SEARCH, roleName, grantor); sentryStore.dropRole(SEARCH, roleName, grantor); }
@Test public void testCreateDropRole() throws Exception { String roleName = "test-drop-role"; String grantor = "grantor"; long seqId = sentryStore.createRole(SEARCH, roleName, grantor).getSequenceId(); assertEquals(seqId + 1, sentryStore.dropRole(SEARCH, roleName, grantor).getSequenceId()); }
@Test public void testCaseInsensitiveCreateDropRole() throws Exception { String roleName1 = "test"; String roleName2 = "TeSt"; String grantor = "grantor"; sentryStore.createRole(SEARCH, roleName1, grantor); try { sentryStore.createRole(SEARCH, roleName2, grantor); fail("Fail to throw Exception"); } catch (SentryAlreadyExistsException e) { //ignore the exception } try { sentryStore.dropRole(SEARCH, roleName2, grantor); } catch (SentryNoSuchObjectException e) { fail("Shouldn't throw SentryNoSuchObjectException"); } }
@Test public void testCaseInsensitiveCreateDropRole() throws Exception { String roleName1 = "test"; String roleName2 = "TeSt"; String grantor = "grantor"; sentryStore.createRole(SEARCH, roleName1, grantor); try { sentryStore.createRole(SEARCH, roleName2, grantor); fail("Fail to throw SentryAlreadyExistsException"); } catch (SentryAlreadyExistsException e) { //ignore the exception } try { sentryStore.dropRole(SEARCH, roleName2, grantor); } catch (SentryNoSuchObjectException e) { fail("Shouldn't throw SentryNoSuchObjectException"); } }