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

package com.azure.resourcemanager.paloaltonetworks.ngfw.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.paloaltonetworks.ngfw.models.EndpointConfiguration;
import com.azure.resourcemanager.paloaltonetworks.ngfw.models.IpAddress;
import org.junit.jupiter.api.Assertions;

public final class EndpointConfigurationTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        EndpointConfiguration model =
            BinaryData
                .fromString(
                    "{\"port\":\"pgvmpipaslthaqfx\",\"address\":{\"resourceId\":\"mwutwbdsre\",\"address\":\"drhneuyow\"}}")
                .toObject(EndpointConfiguration.class);
        Assertions.assertEquals("pgvmpipaslthaqfx", model.port());
        Assertions.assertEquals("mwutwbdsre", model.address().resourceId());
        Assertions.assertEquals("drhneuyow", model.address().address());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        EndpointConfiguration model =
            new EndpointConfiguration()
                .withPort("pgvmpipaslthaqfx")
                .withAddress(new IpAddress().withResourceId("mwutwbdsre").withAddress("drhneuyow"));
        model = BinaryData.fromObject(model).toObject(EndpointConfiguration.class);
        Assertions.assertEquals("pgvmpipaslthaqfx", model.port());
        Assertions.assertEquals("mwutwbdsre", model.address().resourceId());
        Assertions.assertEquals("drhneuyow", model.address().address());
    }
}
