// 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.IntegrationRuntimeOutboundNetworkDependenciesCategoryEndpoint;
import com.azure.resourcemanager.synapse.models.IntegrationRuntimeOutboundNetworkDependenciesEndpoint;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;

public final class IntegrationRuntimeOutboundNetworkDependenciesCategoryEndpointTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        IntegrationRuntimeOutboundNetworkDependenciesCategoryEndpoint model =
            BinaryData
                .fromString(
                    "{\"category\":\"ixjawrtm\",\"endpoints\":[{\"domainName\":\"yccxlzhcox\",\"endpointDetails\":[]},{\"domainName\":\"khenlus\",\"endpointDetails\":[]},{\"domainName\":\"tjxtxr\",\"endpointDetails\":[]},{\"domainName\":\"jvidttge\",\"endpointDetails\":[]}]}")
                .toObject(IntegrationRuntimeOutboundNetworkDependenciesCategoryEndpoint.class);
        Assertions.assertEquals("ixjawrtm", model.category());
        Assertions.assertEquals("yccxlzhcox", model.endpoints().get(0).domainName());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        IntegrationRuntimeOutboundNetworkDependenciesCategoryEndpoint model =
            new IntegrationRuntimeOutboundNetworkDependenciesCategoryEndpoint()
                .withCategory("ixjawrtm")
                .withEndpoints(
                    Arrays
                        .asList(
                            new IntegrationRuntimeOutboundNetworkDependenciesEndpoint()
                                .withDomainName("yccxlzhcox")
                                .withEndpointDetails(Arrays.asList()),
                            new IntegrationRuntimeOutboundNetworkDependenciesEndpoint()
                                .withDomainName("khenlus")
                                .withEndpointDetails(Arrays.asList()),
                            new IntegrationRuntimeOutboundNetworkDependenciesEndpoint()
                                .withDomainName("tjxtxr")
                                .withEndpointDetails(Arrays.asList()),
                            new IntegrationRuntimeOutboundNetworkDependenciesEndpoint()
                                .withDomainName("jvidttge")
                                .withEndpointDetails(Arrays.asList())));
        model =
            BinaryData.fromObject(model).toObject(IntegrationRuntimeOutboundNetworkDependenciesCategoryEndpoint.class);
        Assertions.assertEquals("ixjawrtm", model.category());
        Assertions.assertEquals("yccxlzhcox", model.endpoints().get(0).domainName());
    }
}
