use of com.hazelcast.internal.management.dto.ClusterHotRestartStatusDTO.MemberHotRestartStatus in project hazelcast by hazelcast.
the class ClusterHotRestartStatusDTOTest method testSerialization.
@Test
public void testSerialization() {
Map<String, MemberHotRestartStatus> memberHotRestartStatusMap = new HashMap<String, MemberHotRestartStatus>();
memberHotRestartStatusMap.put("127.0.0.1:5701", MemberHotRestartStatus.PENDING);
memberHotRestartStatusMap.put("127.0.0.1:5702", MemberHotRestartStatus.SUCCESSFUL);
ClusterHotRestartStatusDTO dto = new ClusterHotRestartStatusDTO(HotRestartClusterDataRecoveryPolicy.FULL_RECOVERY_ONLY, ClusterHotRestartStatus.IN_PROGRESS, 23, 42, memberHotRestartStatusMap);
JsonObject json = dto.toJson();
ClusterHotRestartStatusDTO deserialized = new ClusterHotRestartStatusDTO();
deserialized.fromJson(json);
assertEquals(dto.getDataRecoveryPolicy(), deserialized.getDataRecoveryPolicy());
assertEquals(dto.getHotRestartStatus(), deserialized.getHotRestartStatus());
assertEquals(dto.getRemainingValidationTimeMillis(), deserialized.getRemainingValidationTimeMillis());
assertEquals(dto.getRemainingDataLoadTimeMillis(), deserialized.getRemainingDataLoadTimeMillis());
assertEquals(dto.getMemberHotRestartStatusMap(), deserialized.getMemberHotRestartStatusMap());
}
Aggregations