@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); }
@Override public void create_sentry_role(CommitContext context, TCreateSentryRoleRequest request, TCreateSentryRoleResponse response) { for (NotificationHandler handler : handlers) { try { LOGGER.debug("Calling " + handler); handler.create_sentry_role(context, new TCreateSentryRoleRequest(request), new TCreateSentryRoleResponse(response)); } catch (Exception ex) { LOGGER.error("Unexpected error in " + handler + ". Request: " + request + ", Response: " + response, ex); } } }
NotificationHandlerInvoker extends NotificationHandler { @Override public void create_sentry_role(CommitContext context, TCreateSentryRoleRequest request, TCreateSentryRoleResponse response) { for (NotificationHandler handler : handlers) { try { LOGGER.debug("Calling " + handler); handler.create_sentry_role(context, new TCreateSentryRoleRequest(request), new TCreateSentryRoleResponse(response)); } catch (Exception ex) { LOGGER.error("Unexpected error in " + handler + ". Request: " + request + ", Response: " + response, ex); } } } }
NotificationHandlerInvoker extends NotificationHandler { @Override public void create_sentry_role(CommitContext context, TCreateSentryRoleRequest request, TCreateSentryRoleResponse response) { for (NotificationHandler handler : handlers) { try { LOGGER.debug("Calling " + handler); handler.create_sentry_role(context, new TCreateSentryRoleRequest(request), new TCreateSentryRoleResponse(response)); } catch (Exception ex) { LOGGER.error("Unexpected error in " + handler + ". Request: " + request + ", Response: " + response, ex); } } } NotificationHandlerInvoker(Configuration conf, NotificationHandler handler);  NotificationHandlerInvoker(Configuration conf, List<NotificationHandler> handlers); }
NotificationHandlerInvoker extends NotificationHandler { @Override public void create_sentry_role(CommitContext context, TCreateSentryRoleRequest request, TCreateSentryRoleResponse response) { for (NotificationHandler handler : handlers) { try { LOGGER.debug("Calling " + handler); handler.create_sentry_role(context, new TCreateSentryRoleRequest(request), new TCreateSentryRoleResponse(response)); } catch (Exception ex) { LOGGER.error("Unexpected error in " + handler + ". Request: " + request + ", Response: " + response, ex); } } } NotificationHandlerInvoker(Configuration conf, NotificationHandler handler);  NotificationHandlerInvoker(Configuration conf, List<NotificationHandler> handlers); @Override void create_sentry_role(CommitContext context,
                                 TCreateSentryRoleRequest request, TCreateSentryRoleResponse response); @Override void drop_sentry_role(CommitContext context, TDropSentryRoleRequest request,
                               TDropSentryRoleResponse response); @Override void alter_sentry_role_grant_privilege(CommitContext context,
      TAlterSentryRoleGrantPrivilegeRequest request,
      TAlterSentryRoleGrantPrivilegeResponse response); @Override void alter_sentry_role_revoke_privilege(CommitContext context,
      TAlterSentryRoleRevokePrivilegeRequest request,
      TAlterSentryRoleRevokePrivilegeResponse response); @Override void alter_sentry_role_add_groups(CommitContext context,
      TAlterSentryRoleAddGroupsRequest request,
      TAlterSentryRoleAddGroupsResponse response); @Override void alter_sentry_role_delete_groups(
    CommitContext context, TAlterSentryRoleDeleteGroupsRequest request,
    TAlterSentryRoleDeleteGroupsResponse response); }
NotificationHandlerInvoker extends NotificationHandler { @Override public void create_sentry_role(CommitContext context, TCreateSentryRoleRequest request, TCreateSentryRoleResponse response) { for (NotificationHandler handler : handlers) { try { LOGGER.debug("Calling " + handler); handler.create_sentry_role(context, new TCreateSentryRoleRequest(request), new TCreateSentryRoleResponse(response)); } catch (Exception ex) { LOGGER.error("Unexpected error in " + handler + ". Request: " + request + ", Response: " + response, ex); } } } NotificationHandlerInvoker(Configuration conf, NotificationHandler handler);  NotificationHandlerInvoker(Configuration conf, List<NotificationHandler> handlers); @Override void create_sentry_role(CommitContext context,
                                 TCreateSentryRoleRequest request, TCreateSentryRoleResponse response); @Override void drop_sentry_role(CommitContext context, TDropSentryRoleRequest request,
                               TDropSentryRoleResponse response); @Override void alter_sentry_role_grant_privilege(CommitContext context,
      TAlterSentryRoleGrantPrivilegeRequest request,
      TAlterSentryRoleGrantPrivilegeResponse response); @Override void alter_sentry_role_revoke_privilege(CommitContext context,
      TAlterSentryRoleRevokePrivilegeRequest request,
      TAlterSentryRoleRevokePrivilegeResponse response); @Override void alter_sentry_role_add_groups(CommitContext context,
      TAlterSentryRoleAddGroupsRequest request,
      TAlterSentryRoleAddGroupsResponse response); @Override void alter_sentry_role_delete_groups(
    CommitContext context, TAlterSentryRoleDeleteGroupsRequest request,
    TAlterSentryRoleDeleteGroupsResponse response);  }