@Test
  void testRefreshWhenMVWasNotCached() {
    materializedViewsCache.refresh(defaultMV1, defaultMV1, defaultMaterialization1);

    assertThat(materializedViewsCache.get(defaultMV1.getDbName(), defaultMV1.getTableName()), is(defaultMaterialization1));
    assertThat(materializedViewsCache.get(defaultMaterialization1.getAst()).size(), is(1));
    assertThat(materializedViewsCache.get(defaultMaterialization1.getAst()), hasItem(defaultMaterialization1));
    assertThat(materializedViewsCache.isEmpty(), is(false));
    assertThat(materializedViewsCache.values().size(), is(1));
    assertThat(materializedViewsCache.values(), hasItem(defaultMaterialization1));
  }
Functional and parallel execution tests for {@link MaterializedViewsCache}.
Parallel execution test is disabled by default.
ql/src/test/org/apache/hadoop/hive/ql/metadata/TestMaterializedViewsCache.java