@Test
  public void testListStoredProc() 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));

    StoredProcedure proc1 = new StoredProcedure();
    proc1.setSource("print 'Hello world'");
    proc1.setCatName("hive");
    proc1.setOwnerName("user1");
    proc1.setName("proc1");
    proc1.setDbName(DB1);
    objectStore.createOrUpdateStoredProcedure(proc1);

    StoredProcedure proc2 = new StoredProcedure();
    proc2.setSource("print 'Hello world'");
    proc2.setCatName("hive");
    proc2.setOwnerName("user2");
    proc2.setName("proc2");
    proc2.setDbName(DB2);
    objectStore.createOrUpdateStoredProcedure(proc2);

    List<String> result = objectStore.getAllStoredProcedures(new ListStoredProcedureRequest("hive"));
    Assert.assertEquals(2, result.size());
    assertThat(result, hasItems("proc1", "proc2"));

    ListStoredProcedureRequest req = new ListStoredProcedureRequest("hive");
    req.setDbName(DB1);
    result = objectStore.getAllStoredProcedures(req);
    Assert.assertEquals(1, result.size());
    assertThat(result, hasItems("proc1"));
  }
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