### Question:
HdfsSnapshotLocationManager implements SourceLocationManager { @Override public Path getTableLocation() { LOG.debug("Copying source data from: {}", copyBasePath.toString()); sourceCatalogListener.resolvedSourceLocation(copyBasePath.toUri()); return copyBasePath; } HdfsSnapshotLocationManager(
      HiveConf sourceHiveConf,
      String eventId,
      Table sourceTable,
      boolean snapshotsDisabled,
      SourceCatalogListener sourceCatalogListener);   HdfsSnapshotLocationManager(
      HiveConf sourceHiveConf,
      String eventId,
      Table sourceTable,
      boolean snapshotsDisabled,
      String tableBasePath,
      SourceCatalogListener sourceCatalogListener);   HdfsSnapshotLocationManager(
      HiveConf sourceHiveConf,
      String eventId,
      Table sourceTable,
      List<Partition> sourcePartitions,
      boolean snapshotsDisabled,
      String tableBasePath,
      SourceCatalogListener sourceCatalogListener);   HdfsSnapshotLocationManager(
      HiveConf sourceHiveConf,
      String eventId,
      Table sourceTable,
      List<Partition> sourcePartitions,
      boolean snapshotsDisabled,
      String tableBasePath,
      FileSystemFactory fileSystemFactory,
      SourceCatalogListener sourceCatalogListener); @Override Path getTableLocation(); @Override void cleanUpLocations(); @Override List<Path> getPartitionLocations(); @Override Path getPartitionSubPath(Path partitionLocation);  }### Answer:
@Test public void getTableLocationUnpartitionedTableSnapshotsDisabled() throws Exception { HdfsSnapshotLocationManager manager = new HdfsSnapshotLocationManager(hiveConf, EVENT_ID, sourceTable, true, sourceCatalogListener); Path tableLocation = manager.getTableLocation(); assertThat(tableLocation, is(new Path(TABLE_LOCATION))); }
@Test public void getTableLocationPartitionedTableSnapshotsDisabled() throws Exception { StorageDescriptor sd = new StorageDescriptor(); sd.setLocation(TABLE_LOCATION + "/partition1"); partition1.setSd(sd); sd = new StorageDescriptor(); sd.setLocation(TABLE_LOCATION + "/partition2"); partition2.setSd(sd); HdfsSnapshotLocationManager manager = new HdfsSnapshotLocationManager(hiveConf, EVENT_ID, sourceTable, partitions, true, null, sourceCatalogListener); Path tableLocation = manager.getTableLocation(); assertThat(tableLocation, is(new Path(TABLE_LOCATION))); }
@Test public void getTableLocationPartitionedTableSnapshotsDisabledWithOverride() throws Exception { StorageDescriptor sd = new StorageDescriptor(); sd.setLocation(PARTITION_BASE_LOCATION + "/partition1"); partition1.setSd(sd); sd = new StorageDescriptor(); sd.setLocation(PARTITION_BASE_LOCATION + "/partition2"); partition2.setSd(sd); HdfsSnapshotLocationManager manager = new HdfsSnapshotLocationManager(hiveConf, EVENT_ID, sourceTable, partitions, true, PARTITION_BASE_LOCATION, sourceCatalogListener); Path tableLocation = manager.getTableLocation(); assertThat(tableLocation, is(new Path(PARTITION_BASE_LOCATION))); }