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

package com.azure.resourcemanager.cognitiveservices.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.cognitiveservices.fluent.models.PrivateEndpointConnectionInner;
import com.azure.resourcemanager.cognitiveservices.fluent.models.PrivateEndpointConnectionListResultInner;
import com.azure.resourcemanager.cognitiveservices.models.PrivateEndpointConnectionProperties;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;

public final class PrivateEndpointConnectionListResultInnerTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        PrivateEndpointConnectionListResultInner model =
            BinaryData
                .fromString(
                    "{\"value\":[{\"properties\":{\"provisioningState\":\"Creating\",\"groupIds\":[]},\"location\":\"sfxobl\",\"etag\":\"k\",\"id\":\"lmpewwwfbkr\",\"name\":\"rn\",\"type\":\"vshqjohxcr\"},{\"properties\":{\"provisioningState\":\"Deleting\",\"groupIds\":[]},\"location\":\"ruvw\",\"etag\":\"sqfsubcgjbirxb\",\"id\":\"ybsrfbjfdtwss\",\"name\":\"t\",\"type\":\"tpvjzbexilzznfqq\"}]}")
                .toObject(PrivateEndpointConnectionListResultInner.class);
        Assertions.assertEquals("sfxobl", model.value().get(0).location());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        PrivateEndpointConnectionListResultInner model =
            new PrivateEndpointConnectionListResultInner()
                .withValue(
                    Arrays
                        .asList(
                            new PrivateEndpointConnectionInner()
                                .withProperties(new PrivateEndpointConnectionProperties().withGroupIds(Arrays.asList()))
                                .withLocation("sfxobl"),
                            new PrivateEndpointConnectionInner()
                                .withProperties(new PrivateEndpointConnectionProperties().withGroupIds(Arrays.asList()))
                                .withLocation("ruvw")));
        model = BinaryData.fromObject(model).toObject(PrivateEndpointConnectionListResultInner.class);
        Assertions.assertEquals("sfxobl", model.value().get(0).location());
    }
}
