### Question:
HiveMetadataCleaner implements MetadataCleaner { @Override @TimedTaggable("hive-partition-deleted") public boolean dropPartition(HousekeepingMetadata housekeepingMetadata, CleanerClient client) { boolean partitionDeleted = client .dropPartition(housekeepingMetadata.getDatabaseName(), housekeepingMetadata.getTableName(), housekeepingMetadata.getPartitionName()); if (partitionDeleted) { deletedMetadataReporter.reportTaggable(housekeepingMetadata, MetadataType.HIVE_PARTITION); } return partitionDeleted; } HiveMetadataCleaner(DeletedMetadataReporter deletedMetadataReporter); @Override @TimedTaggable("hive-table-deleted") void dropTable(HousekeepingMetadata housekeepingMetadata, CleanerClient client); @Override @TimedTaggable("hive-partition-deleted") boolean dropPartition(HousekeepingMetadata housekeepingMetadata, CleanerClient client); @Override boolean tableExists(CleanerClient client, String databaseName, String tableName);  }### Answer:
@Test public void typicalDropPartition() { when(housekeepingMetadata.getPartitionName()).thenReturn(PARTITION_NAME); when(hiveClient.dropPartition(DATABASE, TABLE_NAME, PARTITION_NAME)).thenReturn(true); cleaner.dropPartition(housekeepingMetadata, hiveClient); verify(deletedMetadataReporter).reportTaggable(housekeepingMetadata, MetadataType.HIVE_PARTITION); }
@Test public void dontReportWhenPartitionNotDropped() { when(housekeepingMetadata.getPartitionName()).thenReturn(PARTITION_NAME); when(hiveClient.dropPartition(DATABASE, TABLE_NAME, PARTITION_NAME)).thenReturn(false); cleaner.dropPartition(housekeepingMetadata, hiveClient); verify(deletedMetadataReporter, never()).reportTaggable(housekeepingMetadata, MetadataType.HIVE_PARTITION); }