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

package com.azure.resourcemanager.databricks.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.databricks.fluent.models.GroupIdInformationInner;
import com.azure.resourcemanager.databricks.models.GroupIdInformationProperties;
import com.azure.resourcemanager.databricks.models.PrivateLinkResourcesList;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;

public final class PrivateLinkResourcesListTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        PrivateLinkResourcesList model =
            BinaryData
                .fromString(
                    "{\"value\":[{\"properties\":{\"groupId\":\"wska\",\"requiredMembers\":[],\"requiredZoneNames\":[]},\"id\":\"tzlcuiywgqywgn\",\"name\":\"rvynhzgpph\",\"type\":\"cgyncocpecf\"},{\"properties\":{\"groupId\":\"mcoo\",\"requiredMembers\":[],\"requiredZoneNames\":[]},\"id\":\"lzevgbmqjqab\",\"name\":\"y\",\"type\":\"mivkwlzuvcc\"}],\"nextLink\":\"nfnbacfionlebxe\"}")
                .toObject(PrivateLinkResourcesList.class);
        Assertions.assertEquals("wska", model.value().get(0).properties().groupId());
        Assertions.assertEquals("nfnbacfionlebxe", model.nextLink());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        PrivateLinkResourcesList model =
            new PrivateLinkResourcesList()
                .withValue(
                    Arrays
                        .asList(
                            new GroupIdInformationInner()
                                .withProperties(
                                    new GroupIdInformationProperties()
                                        .withGroupId("wska")
                                        .withRequiredMembers(Arrays.asList())
                                        .withRequiredZoneNames(Arrays.asList())),
                            new GroupIdInformationInner()
                                .withProperties(
                                    new GroupIdInformationProperties()
                                        .withGroupId("mcoo")
                                        .withRequiredMembers(Arrays.asList())
                                        .withRequiredZoneNames(Arrays.asList()))))
                .withNextLink("nfnbacfionlebxe");
        model = BinaryData.fromObject(model).toObject(PrivateLinkResourcesList.class);
        Assertions.assertEquals("wska", model.value().get(0).properties().groupId());
        Assertions.assertEquals("nfnbacfionlebxe", model.nextLink());
    }
}
