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

package com.azure.resourcemanager.storagepool.generated;

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

public final class OutboundEnvironmentEndpointInnerTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        OutboundEnvironmentEndpointInner model =
            BinaryData
                .fromString(
                    "{\"category\":\"fkbey\",\"endpoints\":[{\"domainName\":\"mjmwvvjektcx\",\"endpointDetails\":[]},{\"domainName\":\"wlrsffrzpwv\",\"endpointDetails\":[]},{\"domainName\":\"gbiqylihkaet\",\"endpointDetails\":[]},{\"domainName\":\"fcivfsnkym\",\"endpointDetails\":[]}]}")
                .toObject(OutboundEnvironmentEndpointInner.class);
        Assertions.assertEquals("fkbey", model.category());
        Assertions.assertEquals("mjmwvvjektcx", model.endpoints().get(0).domainName());
    }

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