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

package com.azure.resourcemanager.kusto.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.kusto.fluent.models.OutboundNetworkDependenciesEndpointInner;
import com.azure.resourcemanager.kusto.models.EndpointDependency;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;

public final class OutboundNetworkDependenciesEndpointInnerTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        OutboundNetworkDependenciesEndpointInner model =
            BinaryData
                .fromString(
                    "{\"properties\":{\"category\":\"edgfbcvkcvq\",\"endpoints\":[{\"domainName\":\"qdcvdrhvoo\",\"endpointDetails\":[]},{\"domainName\":\"tbobz\",\"endpointDetails\":[]},{\"domainName\":\"cjwvn\",\"endpointDetails\":[]},{\"domainName\":\"d\",\"endpointDetails\":[]}],\"provisioningState\":\"Canceled\"},\"etag\":\"xrslpm\",\"id\":\"twuoegrpkhjwni\",\"name\":\"qsluicp\",\"type\":\"ggkzzlvmbmpa\"}")
                .toObject(OutboundNetworkDependenciesEndpointInner.class);
        Assertions.assertEquals("edgfbcvkcvq", model.category());
        Assertions.assertEquals("qdcvdrhvoo", model.endpoints().get(0).domainName());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        OutboundNetworkDependenciesEndpointInner model =
            new OutboundNetworkDependenciesEndpointInner()
                .withCategory("edgfbcvkcvq")
                .withEndpoints(
                    Arrays
                        .asList(
                            new EndpointDependency().withDomainName("qdcvdrhvoo").withEndpointDetails(Arrays.asList()),
                            new EndpointDependency().withDomainName("tbobz").withEndpointDetails(Arrays.asList()),
                            new EndpointDependency().withDomainName("cjwvn").withEndpointDetails(Arrays.asList()),
                            new EndpointDependency().withDomainName("d").withEndpointDetails(Arrays.asList())));
        model = BinaryData.fromObject(model).toObject(OutboundNetworkDependenciesEndpointInner.class);
        Assertions.assertEquals("edgfbcvkcvq", model.category());
        Assertions.assertEquals("qdcvdrhvoo", model.endpoints().get(0).domainName());
    }
}
