@Test(expected = RuntimeException.class) public void testGrantPrivilegeExternalComponentMissingConf() throws SentryUserException { testGrantPrivilege(sentryStore, "externalComponent"); }
@Test(expected = Exception.class) public void testGrantPrivilegeExternalComponentMissingConf() throws Exception { testGrantPrivilege(sentryStore, "externalComponent"); }
/** * Grant query privilege to role r1 */ @Test public void testGrantPrivilege() throws Exception { testGrantPrivilege(sentryStore, SEARCH); }
/** * Grant query privilege to role r1 */ @Test public void testGrantPrivilege() throws Exception { testGrantPrivilege(sentryStore, SEARCH); }
@Test public void testGrantPrivilegeExternalComponent() throws Exception { String externalComponent = "mycomponent"; Configuration confCopy = new Configuration(conf); confCopy.set(String.format(ServiceConstants.ServerConfig.SENTRY_COMPONENT_ACTION_FACTORY_FORMAT, externalComponent), MyComponentActionFactory.class.getName()); SentryStoreLayer store = new DelegateSentryStore(confCopy); testGrantPrivilege(store, externalComponent); }
@Test(expected = Exception.class) public void testGrantPrivilegeExternalComponentInvalidConf() throws Exception { String externalComponent = "mycomponent"; Configuration confCopy = new Configuration(conf); confCopy.set(String.format(ServiceConstants.ServerConfig.SENTRY_COMPONENT_ACTION_FACTORY_FORMAT, externalComponent), InvalidActionFactory.class.getName()); SentryStoreLayer store = new DelegateSentryStore(confCopy); testGrantPrivilege(store, externalComponent); }
@Test(expected = RuntimeException.class) public void testGrantPrivilegeExternalComponentInvalidConf() throws Exception { String externalComponent = "mycomponent"; Configuration confCopy = new Configuration(conf); confCopy.set(String.format(ServiceConstants.ServerConfig.SENTRY_COMPONENT_ACTION_FACTORY_FORMAT, externalComponent), InvalidActionFactory.class.getName()); SentryStoreLayer store = new DelegateSentryStore(confCopy); testGrantPrivilege(store, externalComponent); }
@Test public void testGrantPrivilegeExternalComponent() throws Exception { String externalComponent = "mycomponent"; Configuration confCopy = new Configuration(conf); confCopy.set(String.format(ServiceConstants.ServerConfig.SENTRY_COMPONENT_ACTION_FACTORY_FORMAT, externalComponent), MyComponentActionFactory.class.getName()); SentryStoreLayer store = new DelegateSentryStore(confCopy); testGrantPrivilege(store, externalComponent); }
@Test public void testGrantPrivilegeExternalComponentCaseInsensitivity() throws Exception { String externalComponent = "MyCoMpOnEnT"; Configuration confCopy = new Configuration(conf); confCopy.set(String.format(ServiceConstants.ServerConfig.SENTRY_COMPONENT_ACTION_FACTORY_FORMAT, "mycomponent"), MyComponentActionFactory.class.getName()); SentryStoreLayer store = new DelegateSentryStore(confCopy); testGrantPrivilege(store, externalComponent); }
@Test public void testGrantPrivilegeExternalComponentCaseInsensitivity() throws Exception { String externalComponent = "MyCoMpOnEnT"; Configuration confCopy = new Configuration(conf); confCopy.set(String.format(ServiceConstants.ServerConfig.SENTRY_COMPONENT_ACTION_FACTORY_FORMAT, "mycomponent"), MyComponentActionFactory.class.getName()); SentryStoreLayer store = new DelegateSentryStore(confCopy); testGrantPrivilege(store, externalComponent); }