Skip to content

Commit

Permalink
Remove try catch and organize imports
Browse files Browse the repository at this point in the history
  • Loading branch information
yangyx committed Jul 29, 2024
1 parent 0d67f26 commit 1ff4846
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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<String,String> metaStoreConfigurationProperties = new HashMap<>();
Expand All @@ -170,15 +173,12 @@ 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());
table.setSd(sd);

String oldLocation=sd.getLocation();
assertThat(filterHook.filterTable(table).getSd().getLocation(), equalTo("prefix-test-" + oldLocation ) );
}catch (Exception e){
}
}
}

0 comments on commit 1ff4846

Please sign in to comment.