@Test
  public void testListPackage() throws Exception {
    objectStore.createDatabase(new DatabaseBuilder()
            .setName(DB1)
            .setDescription("description")
            .setLocation("locationurl")
            .build(conf));
    objectStore.createDatabase(new DatabaseBuilder()
            .setName(DB2)
            .setDescription("description")
            .setLocation("locationurl")
            .build(conf));
    AddPackageRequest pkg1 = new AddPackageRequest("hive", DB1, "pkg1", "user1", "header1", "body1");
    AddPackageRequest pkg2 = new AddPackageRequest("hive", DB2, "pkg2", "user1", "header2", "body2");
    objectStore.addPackage(pkg1);
    objectStore.addPackage(pkg2);
    List<String> result = objectStore.listPackages(new ListPackageRequest("hive"));
    assertThat(result, hasItems("pkg1", "pkg2"));
    Assert.assertEquals(2, result.size());
    ListPackageRequest req = new ListPackageRequest("hive");
    req.setDbName(DB1);
    result = objectStore.listPackages(req);
    assertThat(result, hasItems("pkg1"));
    Assert.assertEquals(1, result.size());
  }
Helper method for setting and checking the SSL configuration parameters.
@param useSSL whether or not SSL is enabled
@param trustStorePath truststore path, corresponding to the value for {@link MetastoreConf.ConfVars#DBACCESS_SSL_TRUSTSTORE_PATH}
@param trustStorePassword truststore password, corresponding to the value for {@link MetastoreConf.ConfVars#DBACCESS_SSL_TRUSTSTORE_PASSWORD}
@param trustStoreType truststore type, corresponding to the value for {@link MetastoreConf.ConfVars#DBACCESS_SSL_TRUSTSTORE_TYPE}
standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/TestObjectStore.java