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

package com.azure.resourcemanager.avs.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkPortMirroringInner;
import com.azure.resourcemanager.avs.models.PortMirroringDirectionEnum;
import org.junit.jupiter.api.Assertions;

public final class WorkloadNetworkPortMirroringInnerTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        WorkloadNetworkPortMirroringInner model =
            BinaryData
                .fromString(
                    "{\"properties\":{\"displayName\":\"xqzvszjfa\",\"direction\":\"EGRESS\",\"source\":\"dxxiv\",\"destination\":\"vtcqaqtdo\",\"status\":\"FAILURE\",\"provisioningState\":\"Deleting\",\"revision\":6385965558342410276},\"id\":\"xyslqbh\",\"name\":\"fxoblytkb\",\"type\":\"mpew\"}")
                .toObject(WorkloadNetworkPortMirroringInner.class);
        Assertions.assertEquals("xqzvszjfa", model.displayName());
        Assertions.assertEquals(PortMirroringDirectionEnum.EGRESS, model.direction());
        Assertions.assertEquals("dxxiv", model.source());
        Assertions.assertEquals("vtcqaqtdo", model.destination());
        Assertions.assertEquals(6385965558342410276L, model.revision());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        WorkloadNetworkPortMirroringInner model =
            new WorkloadNetworkPortMirroringInner()
                .withDisplayName("xqzvszjfa")
                .withDirection(PortMirroringDirectionEnum.EGRESS)
                .withSource("dxxiv")
                .withDestination("vtcqaqtdo")
                .withRevision(6385965558342410276L);
        model = BinaryData.fromObject(model).toObject(WorkloadNetworkPortMirroringInner.class);
        Assertions.assertEquals("xqzvszjfa", model.displayName());
        Assertions.assertEquals(PortMirroringDirectionEnum.EGRESS, model.direction());
        Assertions.assertEquals("dxxiv", model.source());
        Assertions.assertEquals("vtcqaqtdo", model.destination());
        Assertions.assertEquals(6385965558342410276L, model.revision());
    }
}
