### Question:
AddCheckSumReplicaTableFactory extends ReplicaTableFactory { @Override Partition newReplicaPartition( String eventId, Table sourceTable, Partition sourcePartition, String replicaDatabaseName, String replicaTableName, Path replicaPartitionLocation, ReplicationMode replicationMode) { Partition replica = super.newReplicaPartition(eventId, sourceTable, sourcePartition, replicaDatabaseName, replicaTableName, replicaPartitionLocation, replicationMode); String checksum = checksumFunction.apply(locationAsPath(sourcePartition)); replica.putToParameters(PARTITION_CHECKSUM.parameterName(), checksum); return replica; } AddCheckSumReplicaTableFactory(
      HiveConf sourceHiveConf,
      Function<Path, String> checksumFunction,
      TableTransformation tableTransformation,
      PartitionTransformation partitionTransformation,
      ColumnStatisticsTransformation columnStatisticsTransformation);   }### Answer:
@Test public void newReplicaPartition() throws Exception { Path sourceTableLocationPath = new Path(sourcePartitionFile.toURI().toString()); when(checksumFunction.apply(sourceTableLocationPath)).thenReturn("checksum"); Partition partition = factory.newReplicaPartition("eventId", sourceTable, sourcePartition, "replicaDatabase", "replicaTable", replicaPartitionLocation, FULL); assertThat(partition.getParameters().get(PARTITION_CHECKSUM.parameterName()), is("checksum")); }