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

package com.azure.resourcemanager.signalr.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.signalr.fluent.models.PrivateLinkResourceInner;
import com.azure.resourcemanager.signalr.models.PrivateLinkResourceList;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;

public final class PrivateLinkResourceListTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        PrivateLinkResourceList model =
            BinaryData
                .fromString(
                    "{\"value\":[{\"properties\":{\"groupId\":\"mubyynt\",\"requiredMembers\":[],\"requiredZoneNames\":[],\"shareablePrivateLinkResourceTypes\":[]},\"id\":\"qtkoievs\",\"name\":\"otgqrlltmu\",\"type\":\"lauwzizxbmpgcjef\"},{\"properties\":{\"groupId\":\"uvpb\",\"requiredMembers\":[],\"requiredZoneNames\":[],\"shareablePrivateLinkResourceTypes\":[]},\"id\":\"morppxebmnzbtbh\",\"name\":\"pglkf\",\"type\":\"ohdneuel\"},{\"properties\":{\"groupId\":\"sdyhtozfikdowwq\",\"requiredMembers\":[],\"requiredZoneNames\":[],\"shareablePrivateLinkResourceTypes\":[]},\"id\":\"zx\",\"name\":\"lvithhqzonosgg\",\"type\":\"hcohfwdsjnk\"}],\"nextLink\":\"jutiiswacff\"}")
                .toObject(PrivateLinkResourceList.class);
        Assertions.assertEquals("mubyynt", model.value().get(0).groupId());
        Assertions.assertEquals("jutiiswacff", model.nextLink());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        PrivateLinkResourceList model =
            new PrivateLinkResourceList()
                .withValue(
                    Arrays
                        .asList(
                            new PrivateLinkResourceInner()
                                .withGroupId("mubyynt")
                                .withRequiredMembers(Arrays.asList())
                                .withRequiredZoneNames(Arrays.asList())
                                .withShareablePrivateLinkResourceTypes(Arrays.asList()),
                            new PrivateLinkResourceInner()
                                .withGroupId("uvpb")
                                .withRequiredMembers(Arrays.asList())
                                .withRequiredZoneNames(Arrays.asList())
                                .withShareablePrivateLinkResourceTypes(Arrays.asList()),
                            new PrivateLinkResourceInner()
                                .withGroupId("sdyhtozfikdowwq")
                                .withRequiredMembers(Arrays.asList())
                                .withRequiredZoneNames(Arrays.asList())
                                .withShareablePrivateLinkResourceTypes(Arrays.asList())))
                .withNextLink("jutiiswacff");
        model = BinaryData.fromObject(model).toObject(PrivateLinkResourceList.class);
        Assertions.assertEquals("mubyynt", model.value().get(0).groupId());
        Assertions.assertEquals("jutiiswacff", model.nextLink());
    }
}
