this.name = name; this.conf = conf; this.notificationHandlerInvoker = new NotificationHandlerInvoker(conf, createHandlers(conf)); isReady = false;
@Test public void testAlterSentryRoleAddGroups() throws Exception { TAlterSentryRoleAddGroupsRequest request = new TAlterSentryRoleAddGroupsRequest(); TAlterSentryRoleAddGroupsResponse response = new TAlterSentryRoleAddGroupsResponse(); invoker.alter_sentry_role_add_groups(commitContext, request, response); Mockito.verify(handler).alter_sentry_role_add_groups(commitContext, request, response); }
@Test public void testAlterSentryRoleDeleteGroups() throws Exception { TAlterSentryRoleDeleteGroupsRequest request = new TAlterSentryRoleDeleteGroupsRequest(); TAlterSentryRoleDeleteGroupsResponse response = new TAlterSentryRoleDeleteGroupsResponse(); invoker.alter_sentry_role_delete_groups(commitContext, request, response); Mockito.verify(handler).alter_sentry_role_delete_groups(commitContext, request, response); }
@Test public void testDropSentryRole() throws Exception { TDropSentryRoleRequest request = new TDropSentryRoleRequest(); TDropSentryRoleResponse response = new TDropSentryRoleResponse(); invoker.drop_sentry_role(commitContext, request, response); Mockito.verify(handler).drop_sentry_role(commitContext, request, response); }
@Test public void testCreateSentryRole() throws Exception { TCreateSentryRoleRequest request = new TCreateSentryRoleRequest(); TCreateSentryRoleResponse response = new TCreateSentryRoleResponse(); invoker.create_sentry_role(commitContext, request, response); Mockito.verify(handler).create_sentry_role(commitContext, request, response); }
request.getRoleName(), request.getPrivileges()); response.setStatus(Status.OK()); notificationHandlerInvoker.alter_sentry_role_revoke_privilege(commitContext, request, response); for (SentryPolicyStorePlugin plugin : sentryPlugins) {
response.setPrivilege(response.getPrivileges().iterator().next()); notificationHandlerInvoker.alter_sentry_role_grant_privilege(commitContext, request, response); for (SentryPolicyStorePlugin plugin : sentryPlugins) {
CommitContext commitContext = sentryStore.dropSentryRole(request.getRoleName()); response.setStatus(Status.OK()); notificationHandlerInvoker.drop_sentry_role(commitContext, request, response); for (SentryPolicyStorePlugin plugin : sentryPlugins) {
CommitContext commitContext = sentryStore.createSentryRole(request.getRoleName()); response.setStatus(Status.OK()); notificationHandlerInvoker.create_sentry_role(commitContext, request, response); } catch (SentryAlreadyExistsException e) {
@Before public void setup() throws Exception { conf = new Configuration(false); commitContext = new CommitContext(UUID.randomUUID(), 1L); handler = Mockito.spy(new NotificationHandler(conf) {}); invoker = new NotificationHandlerInvoker(conf, Lists.newArrayList(new ThrowingNotificationHandler(conf), handler)); }
request.getRoleName(), request.getGroups()); response.setStatus(Status.OK()); notificationHandlerInvoker.alter_sentry_role_add_groups(commitContext, request, response); for (SentryPolicyStorePlugin plugin : sentryPlugins) {
request.getGroups()); response.setStatus(Status.OK()); notificationHandlerInvoker.alter_sentry_role_delete_groups(commitContext, request, response); for (SentryPolicyStorePlugin plugin : sentryPlugins) {