@Test
  public void testAddPartitionSpecUnsupportedPartSpecType() throws Exception {

    createTable();
    PartitionSpec partitionSpec = new PartitionSpec();
    partitionSpec.setDbName(DB_NAME);
    partitionSpec.setTableName(TABLE_NAME);
    partitionSpec.setPartitionList(null);
    partitionSpec.setSharedSDPartitionSpec(null);
    try {
      PartitionSpecProxy bubu = PartitionSpecProxy.Factory.get(partitionSpec);
      client.add_partitions_pspec(bubu);
      Assert.fail("AssertionError should have been thrown.");
    } catch (AssertionError e) {
      // Expected error
    }
  }
Tests for creating partitions from partition spec.
standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/client/TestAddPartitionsFromPartSpec.java