// 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.PrefixObject;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;

public final class PrefixObjectTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        PrefixObject model =
            BinaryData
                .fromString(
                    "{\"description\":\"q\",\"prefixList\":[\"ltmuwlauwzizx\"],\"etag\":\"pgcjefuzmuvp\",\"auditComment\":\"tdum\",\"provisioningState\":\"Canceled\"}")
                .toObject(PrefixObject.class);
        Assertions.assertEquals("q", model.description());
        Assertions.assertEquals("ltmuwlauwzizx", model.prefixList().get(0));
        Assertions.assertEquals("pgcjefuzmuvp", model.etag());
        Assertions.assertEquals("tdum", model.auditComment());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        PrefixObject model =
            new PrefixObject()
                .withDescription("q")
                .withPrefixList(Arrays.asList("ltmuwlauwzizx"))
                .withEtag("pgcjefuzmuvp")
                .withAuditComment("tdum");
        model = BinaryData.fromObject(model).toObject(PrefixObject.class);
        Assertions.assertEquals("q", model.description());
        Assertions.assertEquals("ltmuwlauwzizx", model.prefixList().get(0));
        Assertions.assertEquals("pgcjefuzmuvp", model.etag());
        Assertions.assertEquals("tdum", model.auditComment());
    }
}
