@Test
  @Override
  public void testAddPartitionsNullLocationInTableToo() throws Exception {
    createTable(DB_NAME, TABLE_NAME, null);
    List<Partition> partitions = new ArrayList<>();
    Partition partition = buildPartition(DB_NAME, TABLE_NAME, DEFAULT_YEAR_VALUE, null);
    partitions.add(partition);
    getClient().add_partitions(partitions);

    Partition part = getClient().getPartition(DB_NAME, TABLE_NAME, "year=2017");
    assertEquals(SessionState.get().getTempTables().get(DB_NAME).get(TABLE_NAME).getSd().getLocation() + "/year=2017",
        part.getSd().getLocation());
    Assert.assertTrue(getMetaStore().isPathExists(new Path(part.getSd().getLocation())));
  }
Test class for adding partitions related methods on temporary tables.
ql/src/test/org/apache/hadoop/hive/ql/metadata/TestSessionHiveMetastoreClientAddPartitionsTempTable.java