private ReturnTable createTableNParts(IMetaStoreClient client, boolean authOn, int nParts)
      throws Exception {
    Table t = createTestTable(client, DB_NAME, TABLE_NAME, Lists.newArrayList("yyyy", "mm", "dd"),
            authOn);
    List<List<String>> testValues = new ArrayList<>(nParts);
    for (int i = 0; i < nParts; i++) {
      testValues.add(Lists.newArrayList("2017", "01", String.valueOf(i)));
    }

    for(List<String> vals : testValues) {
      addPartition(client, t, vals);
    }

    return new ReturnTable(t, testValues);
  }
API tests for HMS client's listPartitions methods.
standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/client/TestListPartitions.java