// 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.models.WorkloadNetworkDhcpRelay;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;

public final class WorkloadNetworkDhcpRelayTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        WorkloadNetworkDhcpRelay model =
            BinaryData
                .fromString(
                    "{\"dhcpType\":\"RELAY\",\"serverAddresses\":[\"ttpkiwkkbnujrywv\"],\"displayName\":\"lbfpncurd\",\"segments\":[\"iithtywu\",\"xcbihw\",\"knfd\"],\"provisioningState\":\"Canceled\",\"revision\":7724253777962595356}")
                .toObject(WorkloadNetworkDhcpRelay.class);
        Assertions.assertEquals("lbfpncurd", model.displayName());
        Assertions.assertEquals(7724253777962595356L, model.revision());
        Assertions.assertEquals("ttpkiwkkbnujrywv", model.serverAddresses().get(0));
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        WorkloadNetworkDhcpRelay model =
            new WorkloadNetworkDhcpRelay()
                .withDisplayName("lbfpncurd")
                .withRevision(7724253777962595356L)
                .withServerAddresses(Arrays.asList("ttpkiwkkbnujrywv"));
        model = BinaryData.fromObject(model).toObject(WorkloadNetworkDhcpRelay.class);
        Assertions.assertEquals("lbfpncurd", model.displayName());
        Assertions.assertEquals(7724253777962595356L, model.revision());
        Assertions.assertEquals("ttpkiwkkbnujrywv", model.serverAddresses().get(0));
    }
}
