@Test
  public void testAdminDrainAllowedOnSecureZK() throws Exception {
    if (!secureZKAvailable) {
      return;
    }
    List<ServerName> decommissionedServers = new ArrayList<>(1);
    decommissionedServers.add(ServerName.parseServerName("ZZZ,123,123"));

    // If unable to connect to secure ZK cluster then this operation would fail.
    TEST_UTIL.getAdmin().decommissionRegionServers(decommissionedServers, false);

    decommissionedServers = TEST_UTIL.getAdmin().listDecommissionedRegionServers();
    assertEquals(1, decommissionedServers.size());
    assertEquals(ServerName.parseServerName("ZZZ,123,123"), decommissionedServers.get(0));

    TEST_UTIL.getAdmin().recommissionRegionServer(decommissionedServers.get(0), null);
    decommissionedServers = TEST_UTIL.getAdmin().listDecommissionedRegionServers();
    assertEquals(0, decommissionedServers.size());
  }
Check if Programmatic way of setting zookeeper security settings is valid.
hbase-server/src/test/java/org/apache/hadoop/hbase/zookeeper/TestZooKeeperACL.java