use of com.hazelcast.test.starter.constructor.PartitionReplicaConstructor in project hazelcast by hazelcast.
the class PartitionReplicaConstructorTest method testConstructor.
@Test
public void testConstructor() {
HazelcastInstance hz = createHazelcastInstance();
warmUpPartitions(hz);
InternalPartitionService partitionService = getNode(hz).getPartitionService();
InternalPartition[] partitions = partitionService.getInternalPartitions();
InternalPartitionImpl partition = (InternalPartitionImpl) partitions[0];
PartitionReplica replica = partition.getReplica(0);
PartitionReplicaConstructor constructor = new PartitionReplicaConstructor(PartitionReplica.class);
PartitionReplica clonedReplica = (PartitionReplica) constructor.createNew(replica);
assertEquals(replica.address(), clonedReplica.address());
assertEquals(replica.uuid(), clonedReplica.uuid());
}
Aggregations