@Override
  protected void assertPartitionsHaveCorrectParams(List<Partition> partitions) {
    for (int i = 0; i < partitions.size(); i++) {
      Map<String, String> parameters = partitions.get(i).getParameters();
      assertTrue("included parameter key is not found in the partition",
          parameters.keySet().containsAll(includeKeys));
      assertFalse("excluded parameter key is found in the partition",
          parameters.keySet().stream().anyMatch(key -> excludeKeys.contains(key)));
      assertEquals(includeKeys.size(), parameters.size());
    }
  }
Test class for list partitions with configurable include/exclude pattern on parameters.
Embedded Metastore uses JDO, Remote Metastore uses direct SQL to query the partitions:
MetaStoreFactoryForTests.getMetaStores()
ql/src/test/org/apache/hadoop/hive/metastore/TestListPartitionsWithXIncludeParams.java