diff --git a/waggle-dance-core/src/test/java/com/hotels/bdp/waggledance/mapping/model/MetaStoreMappingFactoryImplTest.java b/waggle-dance-core/src/test/java/com/hotels/bdp/waggledance/mapping/model/MetaStoreMappingFactoryImplTest.java index 7bfc06c4..be91d32c 100644 --- a/waggle-dance-core/src/test/java/com/hotels/bdp/waggledance/mapping/model/MetaStoreMappingFactoryImplTest.java +++ b/waggle-dance-core/src/test/java/com/hotels/bdp/waggledance/mapping/model/MetaStoreMappingFactoryImplTest.java @@ -141,6 +141,23 @@ public void unreachableMetastoreClient() { @Test public void loadMetastoreFilterHookFromConfig() { + AbstractMetaStore federatedMetaStore = newFederatedInstance("fed1", thrift.getThriftConnectionUri()); + federatedMetaStore.setHiveMetastoreFilterHook(PrefixingMetastoreFilter.class.getName()); + MetaStoreMapping mapping = factory.newInstance(federatedMetaStore); + assertThat(mapping, is(notNullValue())); + assertThat(mapping.getMetastoreFilter(), instanceOf(PrefixingMetastoreFilter.class)); + } + + @Test + public void loadDefaultMetastoreFilterHook() { + AbstractMetaStore federatedMetaStore = newFederatedInstance("fed1", thrift.getThriftConnectionUri()); + MetaStoreMapping mapping = factory.newInstance(federatedMetaStore); + assertThat(mapping, is(notNullValue())); + assertThat(mapping.getMetastoreFilter(), instanceOf(DefaultMetaStoreFilterHookImpl.class)); + } + + @Test + public void loadMetastoreFilterHookWithCustomConfig() { AbstractMetaStore federatedMetaStore = newFederatedInstance("fed1", thrift.getThriftConnectionUri()); federatedMetaStore.setHiveMetastoreFilterHook(PrefixingMetastoreFilter.class.getName()); Map metaStoreConfigurationProperties = new HashMap<>(); @@ -149,7 +166,6 @@ public void loadMetastoreFilterHookFromConfig() { MetaStoreMapping mapping = factory.newInstance(federatedMetaStore); assertThat(mapping, is(notNullValue())); - MetaStoreFilterHook filterHook = mapping.getMetastoreFilter(); assertThat(filterHook, instanceOf(PrefixingMetastoreFilter.class)); @@ -165,12 +181,4 @@ public void loadMetastoreFilterHookFromConfig() { }catch (Exception e){ } } - - @Test - public void loadDefaultMetastoreFilterHook() { - AbstractMetaStore federatedMetaStore = newFederatedInstance("fed1", thrift.getThriftConnectionUri()); - MetaStoreMapping mapping = factory.newInstance(federatedMetaStore); - assertThat(mapping, is(notNullValue())); - assertThat(mapping.getMetastoreFilter(), instanceOf(DefaultMetaStoreFilterHookImpl.class)); - } }