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

public final class AdvSecurityObjectListResponseInnerTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        AdvSecurityObjectListResponseInner model =
            BinaryData
                .fromString(
                    "{\"value\":{\"type\":\"dndnvow\",\"entry\":[{\"name\":\"jjugwdkcglhslaz\",\"description\":\"yggdtjixh\"},{\"name\":\"kuofqweykhme\",\"description\":\"vfyexfw\"},{\"name\":\"ybcibvyvdcsit\",\"description\":\"naamde\"}]},\"nextLink\":\"eh\"}")
                .toObject(AdvSecurityObjectListResponseInner.class);
        Assertions.assertEquals("dndnvow", model.value().type());
        Assertions.assertEquals("jjugwdkcglhslaz", model.value().entry().get(0).name());
        Assertions.assertEquals("yggdtjixh", model.value().entry().get(0).description());
        Assertions.assertEquals("eh", model.nextLink());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        AdvSecurityObjectListResponseInner model =
            new AdvSecurityObjectListResponseInner()
                .withValue(
                    new AdvSecurityObjectModel()
                        .withType("dndnvow")
                        .withEntry(
                            Arrays
                                .asList(
                                    new NameDescriptionObject()
                                        .withName("jjugwdkcglhslaz")
                                        .withDescription("yggdtjixh"),
                                    new NameDescriptionObject().withName("kuofqweykhme").withDescription("vfyexfw"),
                                    new NameDescriptionObject().withName("ybcibvyvdcsit").withDescription("naamde"))))
                .withNextLink("eh");
        model = BinaryData.fromObject(model).toObject(AdvSecurityObjectListResponseInner.class);
        Assertions.assertEquals("dndnvow", model.value().type());
        Assertions.assertEquals("jjugwdkcglhslaz", model.value().entry().get(0).name());
        Assertions.assertEquals("yggdtjixh", model.value().entry().get(0).description());
        Assertions.assertEquals("eh", model.nextLink());
    }
}
