From 1ff4846bbc173713a382e190e2e026ad66a18879 Mon Sep 17 00:00:00 2001 From: yangyx <360508847@qq.com> Date: Mon, 29 Jul 2024 15:33:17 +0800 Subject: [PATCH] Remove try catch and organize imports --- .../mapping/model/MetaStoreMappingFactoryImplTest.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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 be91d32c..957f8a17 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 @@ -15,7 +15,10 @@ */ package com.hotels.bdp.waggledance.mapping.model; -import static org.hamcrest.CoreMatchers.*; +import static org.hamcrest.CoreMatchers.instanceOf; +import static org.hamcrest.CoreMatchers.is; +import static org.hamcrest.CoreMatchers.notNullValue; +import static org.hamcrest.CoreMatchers.equalTo; import static org.hamcrest.MatcherAssert.assertThat; import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.verify; @@ -157,7 +160,7 @@ public void loadDefaultMetastoreFilterHook() { } @Test - public void loadMetastoreFilterHookWithCustomConfig() { + public void loadMetastoreFilterHookWithCustomConfig() throws Exception{ AbstractMetaStore federatedMetaStore = newFederatedInstance("fed1", thrift.getThriftConnectionUri()); federatedMetaStore.setHiveMetastoreFilterHook(PrefixingMetastoreFilter.class.getName()); Map metaStoreConfigurationProperties = new HashMap<>(); @@ -170,7 +173,6 @@ public void loadMetastoreFilterHookWithCustomConfig() { assertThat(filterHook, instanceOf(PrefixingMetastoreFilter.class)); Table table = new Table(); - try { StorageDescriptor sd = new StorageDescriptor(); File localWarehouseUri = temporaryFolder.newFolder("local-warehouse"); sd.setLocation(new File(localWarehouseUri,"local_database/local_table").toURI().toString()); @@ -178,7 +180,5 @@ public void loadMetastoreFilterHookWithCustomConfig() { String oldLocation=sd.getLocation(); assertThat(filterHook.filterTable(table).getSd().getLocation(), equalTo("prefix-test-" + oldLocation ) ); - }catch (Exception e){ - } } }