@Test
  public void adminOperationsTest() {
    assertNonQueryTestFail(
        "flush", "803: Only the admin user can perform this operation", "test", "test123");
    assertNonQueryTestFail(
        "clear cache", "803: Only the admin user can perform this operation", "test", "test123");
    assertNonQueryTestFail(
        "set system to readonly",
        "803: Only the admin user can perform this operation",
        "test",
        "test123");
    assertNonQueryTestFail(
        "set system to running",
        "803: Only the admin user can perform this operation",
        "test",
        "test123");
    assertNonQueryTestFail(
        "load configuration",
        "803: Only the admin user can perform this operation",
        "test",
        "test123");
  }
This Class contains integration tests for SystemPermissions but {@link PrivilegeType#MANAGE_USER}
and {@link PrivilegeType#MANAGE_ROLE}, you can see tests of them in {@link IoTDBAuthIT}.
integration-test/src/test/java/org/apache/iotdb/db/it/auth/IoTDBSystemPermissionIT.java