// 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.FqdnListGlobalRulestackResourceInner;
import com.azure.resourcemanager.paloaltonetworks.ngfw.models.FqdnListGlobalRulestackResourceListResult;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;

public final class FqdnListGlobalRulestackResourceListResultTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        FqdnListGlobalRulestackResourceListResult model =
            BinaryData
                .fromString(
                    "{\"value\":[{\"properties\":{\"description\":\"cfvmmco\",\"fqdnList\":[],\"etag\":\"sxlzevgbmqj\",\"auditComment\":\"bcypmi\",\"provisioningState\":\"Deleted\"},\"id\":\"zuvccfwnfnbacfio\",\"name\":\"l\",\"type\":\"bxetqgtzxdpn\"}],\"nextLink\":\"qqwx\"}")
                .toObject(FqdnListGlobalRulestackResourceListResult.class);
        Assertions.assertEquals("cfvmmco", model.value().get(0).description());
        Assertions.assertEquals("sxlzevgbmqj", model.value().get(0).etag());
        Assertions.assertEquals("bcypmi", model.value().get(0).auditComment());
        Assertions.assertEquals("qqwx", model.nextLink());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        FqdnListGlobalRulestackResourceListResult model =
            new FqdnListGlobalRulestackResourceListResult()
                .withValue(
                    Arrays
                        .asList(
                            new FqdnListGlobalRulestackResourceInner()
                                .withDescription("cfvmmco")
                                .withFqdnList(Arrays.asList())
                                .withEtag("sxlzevgbmqj")
                                .withAuditComment("bcypmi")))
                .withNextLink("qqwx");
        model = BinaryData.fromObject(model).toObject(FqdnListGlobalRulestackResourceListResult.class);
        Assertions.assertEquals("cfvmmco", model.value().get(0).description());
        Assertions.assertEquals("sxlzevgbmqj", model.value().get(0).etag());
        Assertions.assertEquals("bcypmi", model.value().get(0).auditComment());
        Assertions.assertEquals("qqwx", model.nextLink());
    }
}
