protected void addPartitions(IMetaStoreClient client, Table table, List<String> values) throws Exception {
    List<Partition> partitions = new ArrayList<>();
    for (int i = 0; i < values.size(); i++) {
      partitions.add(new PartitionBuilder().inTable(table)
          .addValue(values.get(i))
          .setLocation(MetaStoreTestUtils.getTestWarehouseDir(values.get(i) + i))
          .build(metaStore.getConf()));
    }
    client.add_partitions(partitions);
  }
API tests for HMS client's  alterPartitions methods.
standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/client/TestAlterPartitions.java