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

package com.azure.resourcemanager.peering.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.peering.fluent.models.CdnPeeringPrefixInner;
import com.azure.resourcemanager.peering.models.CdnPeeringPrefixListResult;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;

public final class CdnPeeringPrefixListResultTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        CdnPeeringPrefixListResult model =
            BinaryData
                .fromString(
                    "{\"value\":[{\"properties\":{\"prefix\":\"uv\",\"azureRegion\":\"xpyb\",\"azureService\":\"m\",\"isPrimaryRegion\":false,\"bgpCommunity\":\"zopbsphrupidgs\"},\"id\":\"bb\",\"name\":\"jhphoyc\",\"type\":\"sx\"},{\"properties\":{\"prefix\":\"hdxbmtqio\",\"azureRegion\":\"zehtbmu\",\"azureService\":\"ownoizhw\",\"isPrimaryRegion\":true,\"bgpCommunity\":\"bqsoqijg\"},\"id\":\"dmbpazlobcufpdz\",\"name\":\"rbt\",\"type\":\"qqjnqgl\"},{\"properties\":{\"prefix\":\"nufo\",\"azureRegion\":\"jywif\",\"azureService\":\"esaagdfm\",\"isPrimaryRegion\":true,\"bgpCommunity\":\"hjxri\"},\"id\":\"kwm\",\"name\":\"vktsizntocipao\",\"type\":\"ajpsquc\"}],\"nextLink\":\"o\"}")
                .toObject(CdnPeeringPrefixListResult.class);
        Assertions.assertEquals("o", model.nextLink());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        CdnPeeringPrefixListResult model =
            new CdnPeeringPrefixListResult()
                .withValue(
                    Arrays
                        .asList(new CdnPeeringPrefixInner(), new CdnPeeringPrefixInner(), new CdnPeeringPrefixInner()))
                .withNextLink("o");
        model = BinaryData.fromObject(model).toObject(CdnPeeringPrefixListResult.class);
        Assertions.assertEquals("o", model.nextLink());
    }
}
