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

public final class CertificateObjectLocalRulestackResourceListResultTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        CertificateObjectLocalRulestackResourceListResult model =
            BinaryData
                .fromString(
                    "{\"value\":[{\"properties\":{\"certificateSignerResourceId\":\"oorb\",\"certificateSelfSigned\":\"FALSE\",\"auditComment\":\"ybfhjxa\",\"description\":\"vjgsl\",\"etag\":\"dilmyww\",\"provisioningState\":\"Succeeded\"},\"id\":\"xnyed\",\"name\":\"b\",\"type\":\"yvudtjuewbci\"}],\"nextLink\":\"uuwhcjyxcc\"}")
                .toObject(CertificateObjectLocalRulestackResourceListResult.class);
        Assertions.assertEquals("oorb", model.value().get(0).certificateSignerResourceId());
        Assertions.assertEquals(BooleanEnum.FALSE, model.value().get(0).certificateSelfSigned());
        Assertions.assertEquals("ybfhjxa", model.value().get(0).auditComment());
        Assertions.assertEquals("vjgsl", model.value().get(0).description());
        Assertions.assertEquals("dilmyww", model.value().get(0).etag());
        Assertions.assertEquals("uuwhcjyxcc", model.nextLink());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        CertificateObjectLocalRulestackResourceListResult model =
            new CertificateObjectLocalRulestackResourceListResult()
                .withValue(
                    Arrays
                        .asList(
                            new CertificateObjectLocalRulestackResourceInner()
                                .withCertificateSignerResourceId("oorb")
                                .withCertificateSelfSigned(BooleanEnum.FALSE)
                                .withAuditComment("ybfhjxa")
                                .withDescription("vjgsl")
                                .withEtag("dilmyww")))
                .withNextLink("uuwhcjyxcc");
        model = BinaryData.fromObject(model).toObject(CertificateObjectLocalRulestackResourceListResult.class);
        Assertions.assertEquals("oorb", model.value().get(0).certificateSignerResourceId());
        Assertions.assertEquals(BooleanEnum.FALSE, model.value().get(0).certificateSelfSigned());
        Assertions.assertEquals("ybfhjxa", model.value().get(0).auditComment());
        Assertions.assertEquals("vjgsl", model.value().get(0).description());
        Assertions.assertEquals("dilmyww", model.value().get(0).etag());
        Assertions.assertEquals("uuwhcjyxcc", model.nextLink());
    }
}
