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

package com.azure.resourcemanager.deviceupdate.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.deviceupdate.fluent.models.GroupInformationInner;
import com.azure.resourcemanager.deviceupdate.models.PrivateLinkResourceListResult;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;

public final class PrivateLinkResourceListResultTests {
    @Test
    public void testDeserialize() {
        PrivateLinkResourceListResult model =
            BinaryData
                .fromString(
                    "{\"value\":[{\"properties\":{\"provisioningState\":\"Failed\",\"groupId\":\"epgzgqexz\",\"requiredMembers\":[],\"requiredZoneNames\":[]},\"id\":\"xscpaierhhbc\",\"name\":\"glu\",\"type\":\"majtjaod\"},{\"properties\":{\"provisioningState\":\"Succeeded\",\"groupId\":\"bdxkqpxokaj\",\"requiredMembers\":[],\"requiredZoneNames\":[]},\"id\":\"pimexgstxgcpodg\",\"name\":\"aajrm\",\"type\":\"djwzrlov\"},{\"properties\":{\"provisioningState\":\"Canceled\",\"groupId\":\"hijco\",\"requiredMembers\":[],\"requiredZoneNames\":[]},\"id\":\"tbzaqsqsycbkbfk\",\"name\":\"ukdkexxppofmxa\",\"type\":\"c\"},{\"properties\":{\"provisioningState\":\"Succeeded\",\"groupId\":\"ddtocjjxhvp\",\"requiredMembers\":[],\"requiredZoneNames\":[]},\"id\":\"exhd\",\"name\":\"xibqeojnx\",\"type\":\"bzv\"}],\"nextLink\":\"ntwndeicbtwnpzao\"}")
                .toObject(PrivateLinkResourceListResult.class);
        Assertions.assertEquals("ntwndeicbtwnpzao", model.nextLink());
    }

    @Test
    public void testSerialize() {
        PrivateLinkResourceListResult model =
            new PrivateLinkResourceListResult()
                .withValue(
                    Arrays
                        .asList(
                            new GroupInformationInner().withRequiredZoneNames(Arrays.asList()),
                            new GroupInformationInner().withRequiredZoneNames(Arrays.asList()),
                            new GroupInformationInner().withRequiredZoneNames(Arrays.asList()),
                            new GroupInformationInner().withRequiredZoneNames(Arrays.asList())))
                .withNextLink("ntwndeicbtwnpzao");
        model = BinaryData.fromObject(model).toObject(PrivateLinkResourceListResult.class);
        Assertions.assertEquals("ntwndeicbtwnpzao", model.nextLink());
    }
}
