// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.resourcemanager.netapp.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.netapp.fluent.models.ReplicationStatusInner;
import com.azure.resourcemanager.netapp.models.MirrorState;
import com.azure.resourcemanager.netapp.models.RelationshipStatus;
import org.junit.jupiter.api.Assertions;

public final class ReplicationStatusInnerTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        ReplicationStatusInner model =
            BinaryData
                .fromString(
                    "{\"healthy\":false,\"relationshipStatus\":\"Idle\",\"mirrorState\":\"Mirrored\",\"totalProgress\":\"jusrtslhspk\",\"errorMessage\":\"emaofmxagkvt\"}")
                .toObject(ReplicationStatusInner.class);
        Assertions.assertEquals(false, model.healthy());
        Assertions.assertEquals(RelationshipStatus.IDLE, model.relationshipStatus());
        Assertions.assertEquals(MirrorState.MIRRORED, model.mirrorState());
        Assertions.assertEquals("jusrtslhspk", model.totalProgress());
        Assertions.assertEquals("emaofmxagkvt", model.errorMessage());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        ReplicationStatusInner model =
            new ReplicationStatusInner()
                .withHealthy(false)
                .withRelationshipStatus(RelationshipStatus.IDLE)
                .withMirrorState(MirrorState.MIRRORED)
                .withTotalProgress("jusrtslhspk")
                .withErrorMessage("emaofmxagkvt");
        model = BinaryData.fromObject(model).toObject(ReplicationStatusInner.class);
        Assertions.assertEquals(false, model.healthy());
        Assertions.assertEquals(RelationshipStatus.IDLE, model.relationshipStatus());
        Assertions.assertEquals(MirrorState.MIRRORED, model.mirrorState());
        Assertions.assertEquals("jusrtslhspk", model.totalProgress());
        Assertions.assertEquals("emaofmxagkvt", model.errorMessage());
    }
}
