### Question:
HiveClient implements CleanerClient { @Override public void dropTable(String databaseName, String tableName) { if (dryRunEnabled) { log.info("Dry run - dropping table \"{}.{}\"", databaseName, tableName); } else { try { log.info("Dropping table \"{}.{}\"", databaseName, tableName); client.dropTable(databaseName, tableName); } catch (NoSuchObjectException e) { log.info("Could not drop table: table not found: \"{}.{}\"", databaseName, tableName); } catch (TException e) { throw new BeekeeperException( "Unexpected exception when dropping table: \"" + databaseName + "." + tableName + "\".", e); } } } HiveClient(CloseableMetaStoreClient client, boolean dryRunEnabled); @Override void dropTable(String databaseName, String tableName); @Override boolean dropPartition(String databaseName, String tableName, String partitionName); @Override boolean tableExists(String databaseName, String tableName); @Override void close();  }### Answer:
@Test public void typicalDropTable() throws TException { hiveClient.dropTable(DATABASE, TABLE_NAME); verify(client).dropTable(DATABASE, TABLE_NAME); }
@Test public void typicalDropTableDryRun() throws TException { hiveClient = new HiveClient(client, true); hiveClient.dropTable(DATABASE, TABLE_NAME); verify(client, never()).dropTable(DATABASE, TABLE_NAME); }
@Test public void dontThrowErrorWhenTableAlreadyDropped() throws TException { Mockito.doThrow(NoSuchObjectException.class).when(client).dropTable(DATABASE, TABLE_NAME); hiveClient.dropTable(DATABASE, TABLE_NAME); verify(client).dropTable(DATABASE, TABLE_NAME); }
@Test public void throwsExceptionForDropTable() throws TException { Mockito.doThrow(MetaException.class).when(client).dropTable(DATABASE, TABLE_NAME); assertThrows(BeekeeperException.class, () -> { hiveClient.dropTable(DATABASE, TABLE_NAME); }); }