CommandUtil { public static String createCmdForCreateOrDropRole(String roleName, boolean isCreate) { if (isCreate) { return "CREATE ROLE " + roleName; } return "DROP ROLE " + roleName; } CommandUtil(); static String createCmdForCreateOrDropRole(String roleName,
      boolean isCreate); static String createCmdForRoleAddGroup(String roleName, String groups); static String createCmdForRoleDeleteGroup(String roleName, String groups); static String createCmdForRoleAddUser(String roleName, String users); static String createCmdForRoleDeleteUser(String roleName, String users); static String createCmdForGrantPrivilege(
      TAlterSentryRoleGrantPrivilegeRequest request); static String createCmdForRevokePrivilege(
      TAlterSentryRoleRevokePrivilegeRequest request); static String createCmdForGrantGMPrivilege(
      org.apache.sentry.api.generic.thrift.TAlterSentryRoleGrantPrivilegeRequest request); static String createCmdForRevokeGMPrivilege(
      org.apache.sentry.api.generic.thrift.TAlterSentryRoleRevokePrivilegeRequest request); static String createCmdForImplicitGrantOwnerPrivilege(TSentryPrincipalType ownerType,
    String ownerName, TSentryAuthorizable authorizable); static String createCmdForImplicitTransferOwnerPrivilege(TSentryPrincipalType ownerType,
    String ownerName, TSentryAuthorizable authorizable); @VisibleForTesting static boolean assertIPInAuditLog(String ipInAuditLog);  }
@Test public void testCreateCmdForCreateOrDropRole() { String roleName = "testRole"; String createRoleCmdResult = CommandUtil.createCmdForCreateOrDropRole( roleName, true); String dropRoleCmdResult = CommandUtil.createCmdForCreateOrDropRole( roleName, false); String createRoleCmdExcepted = "CREATE ROLE testRole"; String dropRoleCmdExcepted = "DROP ROLE testRole"; assertEquals(createRoleCmdExcepted, createRoleCmdResult); assertEquals(dropRoleCmdResult, dropRoleCmdExcepted); }