@Test
  public void testTruncateTableUnpartitioned() throws Exception {
    // Unpartitioned table
    Path dataFile = new Path(testTables[0].getSd().getLocation() + "/dataFile");
    client.truncateTable(testTables[0].getDbName(), testTables[0].getTableName(), null);
    Assert.assertTrue("Location should exist",
        metaStore.isPathExists(new Path(testTables[0].getSd().getLocation())));
    Assert.assertFalse("DataFile should be removed", metaStore.isPathExists(dataFile));

  }
This test creates and queries a table and then drops it. Good for testing the happy path
standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/client/TestTablesCreateDropAlterTruncate.java