@Test
  public void testUpdateCreationMetadataSetsMaterializationTime() throws Exception {
    Database db1 = new DatabaseBuilder()
            .setName(DB1)
            .setDescription("description")
            .setLocation("locationurl")
            .build(conf);
    objectStore.createDatabase(db1);

    StorageDescriptor sd1 =
            new StorageDescriptor(ImmutableList.of(new FieldSchema("pk_col", "double", null)),
                    "location", null, null, false, 0, new SerDeInfo("SerDeName", "serializationLib", null),
                    null, null, null);
    HashMap<String, String> params = new HashMap<>();
    params.put("EXTERNAL", "false");
    Table tbl1 = new Table(TABLE1, DB1, "owner", 1, 2, 3, sd1, null, params, null, null, "MANAGED_TABLE");
    tbl1.setCatName(db1.getCatalogName());
    objectStore.createTable(tbl1);

    Table matView1 = new Table("mat1", DB1, "owner", 1, 2, 3, sd1, null, params, null, null, "MATERIALIZED_VIEW");
    matView1.setCatName(db1.getCatalogName());

    CreationMetadata creationMetadata = new CreationMetadata();
    creationMetadata.setCatName(db1.getCatalogName());
    creationMetadata.setDbName(matView1.getDbName());
    creationMetadata.setTblName(matView1.getTableName());
    creationMetadata.setTablesUsed(Collections.singleton(tbl1.getDbName() + "." + tbl1.getTableName()));
    creationMetadata.setSourceTables(Collections.singletonList(createSourceTable(tbl1)));
    matView1.setCreationMetadata(creationMetadata);
    objectStore.createTable(matView1);

    CreationMetadata newCreationMetadata = new CreationMetadata(matView1.getCatName(), matView1.getDbName(),
            matView1.getTableName(), ImmutableSet.copyOf(creationMetadata.getTablesUsed()));
    newCreationMetadata.setSourceTables(Collections.unmodifiableList(creationMetadata.getSourceTables()));
    objectStore.updateCreationMetadata(matView1.getCatName(), matView1.getDbName(), matView1.getTableName(), newCreationMetadata);

    assertThat(creationMetadata.getMaterializationTime(), is(not(0)));
  }
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