### Question:
FullReplicationReplicaLocationManager implements ReplicaLocationManager { @Override public Path getPartitionLocation(Partition sourcePartition) { if (tableType == UNPARTITIONED) { throw new UnsupportedOperationException("Not a partitioned table."); } Path partitionSubPath = sourceLocationManager.getPartitionSubPath(locationAsPath(sourcePartition)); Path replicaPartitionLocation = new Path(getPartitionBaseLocation(), partitionSubPath); return replicaPartitionLocation; } FullReplicationReplicaLocationManager(
      SourceLocationManager sourceLocationManager,
      String tablePath,
      String eventId,
      TableType tableType,
      CleanupLocationManager cleanupLocationManager,
      ReplicaCatalogListener replicaCatalogListener); @Override Path getTableLocation(); @Override Path getPartitionBaseLocation(); @Override void addCleanUpLocation(String pathEventId, Path location); @Override void cleanUpLocations(); @Override Path getPartitionLocation(Partition sourcePartition);  }### Answer:
@Test(expected = UnsupportedOperationException.class) public void getPartitionLocationOnUnpartitionedTable() throws Exception { FullReplicationReplicaLocationManager manager = new FullReplicationReplicaLocationManager(sourceLocationManager, TABLE_PATH, EVENT_ID, UNPARTITIONED, cleanupLocationManager, replicaCatalogListener); manager.getPartitionLocation(sourcePartition); }
@Test public void getPartitionLocationOnPartitionedTable() throws Exception { FullReplicationReplicaLocationManager manager = new FullReplicationReplicaLocationManager(sourceLocationManager, TABLE_PATH, EVENT_ID, PARTITIONED, cleanupLocationManager, replicaCatalogListener); when(sourcePartition.getSd()).thenReturn(sd); String partitionLocation = TABLE_PATH + "/" + EVENT_ID + "/partitionKey1=value"; when(sd.getLocation()).thenReturn(partitionLocation); when(sourceLocationManager.getPartitionSubPath(new Path(partitionLocation))) .thenReturn(new Path("partitionKey1=value")); Path path = manager.getPartitionLocation(sourcePartition); assertThat(path, is(new Path(partitionLocation))); }