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

package com.azure.resourcemanager.paloaltonetworks.ngfw.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.paloaltonetworks.ngfw.fluent.models.PrefixListGlobalRulestackResourceInner;
import com.azure.resourcemanager.paloaltonetworks.ngfw.models.PrefixListGlobalRulestackResourceListResult;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;

public final class PrefixListGlobalRulestackResourceListResultTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        PrefixListGlobalRulestackResourceListResult model =
            BinaryData
                .fromString(
                    "{\"value\":[{\"properties\":{\"description\":\"aruoujmkcjhwqyt\",\"prefixList\":[],\"etag\":\"ybn\",\"auditComment\":\"ewgdrjervn\",\"provisioningState\":\"NotSpecified\"},\"id\":\"pehindoygm\",\"name\":\"fthnzdn\",\"type\":\"sl\"},{\"properties\":{\"description\":\"ayqigynduhav\",\"prefixList\":[],\"etag\":\"lkthu\",\"auditComment\":\"qolbgyc\",\"provisioningState\":\"NotSpecified\"},\"id\":\"r\",\"name\":\"gccymvaolpssl\",\"type\":\"lfmmdnbbglzpswi\"},{\"properties\":{\"description\":\"mcwyhzdxssadb\",\"prefixList\":[],\"etag\":\"nvdfznuda\",\"auditComment\":\"vxzbncb\",\"provisioningState\":\"Deleting\"},\"id\":\"stdbhhxsrzdzu\",\"name\":\"erscdntne\",\"type\":\"fiwjmygtdssls\"},{\"properties\":{\"description\":\"mweriofzpy\",\"prefixList\":[],\"etag\":\"emwabnet\",\"auditComment\":\"hszhedplvwiwu\",\"provisioningState\":\"Deleting\"},\"id\":\"besldnkwwtppjflc\",\"name\":\"ogaok\",\"type\":\"nzmnsikvm\"}],\"nextLink\":\"ze\"}")
                .toObject(PrefixListGlobalRulestackResourceListResult.class);
        Assertions.assertEquals("aruoujmkcjhwqyt", model.value().get(0).description());
        Assertions.assertEquals("ybn", model.value().get(0).etag());
        Assertions.assertEquals("ewgdrjervn", model.value().get(0).auditComment());
        Assertions.assertEquals("ze", model.nextLink());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        PrefixListGlobalRulestackResourceListResult model =
            new PrefixListGlobalRulestackResourceListResult()
                .withValue(
                    Arrays
                        .asList(
                            new PrefixListGlobalRulestackResourceInner()
                                .withDescription("aruoujmkcjhwqyt")
                                .withPrefixList(Arrays.asList())
                                .withEtag("ybn")
                                .withAuditComment("ewgdrjervn"),
                            new PrefixListGlobalRulestackResourceInner()
                                .withDescription("ayqigynduhav")
                                .withPrefixList(Arrays.asList())
                                .withEtag("lkthu")
                                .withAuditComment("qolbgyc"),
                            new PrefixListGlobalRulestackResourceInner()
                                .withDescription("mcwyhzdxssadb")
                                .withPrefixList(Arrays.asList())
                                .withEtag("nvdfznuda")
                                .withAuditComment("vxzbncb"),
                            new PrefixListGlobalRulestackResourceInner()
                                .withDescription("mweriofzpy")
                                .withPrefixList(Arrays.asList())
                                .withEtag("emwabnet")
                                .withAuditComment("hszhedplvwiwu")))
                .withNextLink("ze");
        model = BinaryData.fromObject(model).toObject(PrefixListGlobalRulestackResourceListResult.class);
        Assertions.assertEquals("aruoujmkcjhwqyt", model.value().get(0).description());
        Assertions.assertEquals("ybn", model.value().get(0).etag());
        Assertions.assertEquals("ewgdrjervn", model.value().get(0).auditComment());
        Assertions.assertEquals("ze", model.nextLink());
    }
}
