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

package com.azure.resourcemanager.synapse.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.synapse.models.IntegrationRuntimeOutboundNetworkDependenciesEndpoint;
import com.azure.resourcemanager.synapse.models.IntegrationRuntimeOutboundNetworkDependenciesEndpointDetails;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;

public final class IntegrationRuntimeOutboundNetworkDependenciesEndpointTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        IntegrationRuntimeOutboundNetworkDependenciesEndpoint model =
            BinaryData
                .fromString("{\"domainName\":\"vyjtcvu\",\"endpointDetails\":[{\"port\":1264024384}]}")
                .toObject(IntegrationRuntimeOutboundNetworkDependenciesEndpoint.class);
        Assertions.assertEquals("vyjtcvu", model.domainName());
        Assertions.assertEquals(1264024384, model.endpointDetails().get(0).port());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        IntegrationRuntimeOutboundNetworkDependenciesEndpoint model =
            new IntegrationRuntimeOutboundNetworkDependenciesEndpoint()
                .withDomainName("vyjtcvu")
                .withEndpointDetails(
                    Arrays
                        .asList(
                            new IntegrationRuntimeOutboundNetworkDependenciesEndpointDetails().withPort(1264024384)));
        model = BinaryData.fromObject(model).toObject(IntegrationRuntimeOutboundNetworkDependenciesEndpoint.class);
        Assertions.assertEquals("vyjtcvu", model.domainName());
        Assertions.assertEquals(1264024384, model.endpointDetails().get(0).port());
    }
}
