// 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.WorkloadNetworkPortMirroringProperties;
import com.azure.resourcemanager.avs.models.PortMirroringDirectionEnum;
import org.junit.jupiter.api.Assertions;

public final class WorkloadNetworkPortMirroringPropertiesTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        WorkloadNetworkPortMirroringProperties model =
            BinaryData
                .fromString(
                    "{\"displayName\":\"fbkrvrnsvs\",\"direction\":\"EGRESS\",\"source\":\"hxcr\",\"destination\":\"fovasr\",\"status\":\"SUCCESS\",\"provisioningState\":\"Updating\",\"revision\":5986857107017021380}")
                .toObject(WorkloadNetworkPortMirroringProperties.class);
        Assertions.assertEquals("fbkrvrnsvs", model.displayName());
        Assertions.assertEquals(PortMirroringDirectionEnum.EGRESS, model.direction());
        Assertions.assertEquals("hxcr", model.source());
        Assertions.assertEquals("fovasr", model.destination());
        Assertions.assertEquals(5986857107017021380L, model.revision());
    }

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