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

public final class OutboundNetworkDependenciesEndpointPropertiesTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        OutboundNetworkDependenciesEndpointProperties model =
            BinaryData
                .fromString(
                    "{\"category\":\"odfvuefywsbp\",\"endpoints\":[{\"domainName\":\"yhrfouyftaakcpw\",\"endpointDetails\":[]},{\"domainName\":\"qtmnubexkpzk\",\"endpointDetails\":[]}],\"provisioningState\":\"Failed\"}")
                .toObject(OutboundNetworkDependenciesEndpointProperties.class);
        Assertions.assertEquals("odfvuefywsbp", model.category());
        Assertions.assertEquals("yhrfouyftaakcpw", model.endpoints().get(0).domainName());
    }

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