CommandUtil { public static String createCmdForCreateOrDropRole(String roleName, boolean isCreate) { if (isCreate) { return "CREATE ROLE " + roleName; } return "DROP ROLE " + roleName; }  static String createCmdForCreateOrDropRole(String roleName,
      boolean isCreate); static String createCmdForRoleAddGroup(String roleName, String groups); static String createCmdForRoleDeleteGroup(String roleName, String groups); static String createCmdForGrantPrivilege(
      TAlterSentryRoleGrantPrivilegeRequest request); static String createCmdForRevokePrivilege(
      TAlterSentryRoleRevokePrivilegeRequest request); static String createCmdForGrantGMPrivilege(
      org.apache.sentry.provider.db.generic.service.thrift.TAlterSentryRoleGrantPrivilegeRequest request); static String createCmdForRevokeGMPrivilege(
      org.apache.sentry.provider.db.generic.service.thrift.TAlterSentryRoleRevokePrivilegeRequest request); @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); }