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

public final class PredefinedUrlCategoriesResponseInnerTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        PredefinedUrlCategoriesResponseInner model =
            BinaryData
                .fromString(
                    "{\"value\":[{\"action\":\"vjsllrmvvdfw\",\"name\":\"t\"},{\"action\":\"pnpulexxbczwtru\",\"name\":\"iqzbq\"},{\"action\":\"vsovmyokac\",\"name\":\"pkwlhz\"}],\"nextLink\":\"bpxjmfl\"}")
                .toObject(PredefinedUrlCategoriesResponseInner.class);
        Assertions.assertEquals("vjsllrmvvdfw", model.value().get(0).action());
        Assertions.assertEquals("t", model.value().get(0).name());
        Assertions.assertEquals("bpxjmfl", model.nextLink());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        PredefinedUrlCategoriesResponseInner model =
            new PredefinedUrlCategoriesResponseInner()
                .withValue(
                    Arrays
                        .asList(
                            new PredefinedUrlCategory().withAction("vjsllrmvvdfw").withName("t"),
                            new PredefinedUrlCategory().withAction("pnpulexxbczwtru").withName("iqzbq"),
                            new PredefinedUrlCategory().withAction("vsovmyokac").withName("pkwlhz")))
                .withNextLink("bpxjmfl");
        model = BinaryData.fromObject(model).toObject(PredefinedUrlCategoriesResponseInner.class);
        Assertions.assertEquals("vjsllrmvvdfw", model.value().get(0).action());
        Assertions.assertEquals("t", model.value().get(0).name());
        Assertions.assertEquals("bpxjmfl", model.nextLink());
    }
}
