@Test(expected = AssertionError.class)
  public void testListPartitionsSpecByExprNullResult() throws Exception {
    Table t = createTable4PartColsParts(getClient()).table;

    TestMetastoreExpr.ExprBuilder e = new TestMetastoreExpr.ExprBuilder(TABLE_NAME);

    PartitionsByExprRequest req = new PartitionsByExprRequest(DB_NAME, TABLE_NAME,
            ByteBuffer.wrap(SerializationUtilities.serializeObjectWithTypeInformation(
                    e.strCol("yyyy").val("2017").pred("=", 2).build())));
    req.setMaxParts((short)-1);
    req.setId(t.getId());

    getClient().listPartitionsSpecByExpr(req, null);
  }
Test class for list partitions related methods on temporary tables.
ql/src/test/org/apache/hadoop/hive/ql/metadata/TestSessionHiveMetastoreClientListPartitionsTempTable.java