// 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 org.junit.jupiter.api.Assertions;

public final class CertificateObjectLocalRulestackResourceInnerTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        CertificateObjectLocalRulestackResourceInner model =
            BinaryData
                .fromString(
                    "{\"properties\":{\"certificateSignerResourceId\":\"vpayakkudzpx\",\"certificateSelfSigned\":\"TRUE\",\"auditComment\":\"plmag\",\"description\":\"cyohpfkyrkdbd\",\"etag\":\"ogsjkmnwqjno\",\"provisioningState\":\"Updating\"},\"id\":\"hdd\",\"name\":\"iacegfnmn\",\"type\":\"fpmvmemfnczd\"}")
                .toObject(CertificateObjectLocalRulestackResourceInner.class);
        Assertions.assertEquals("vpayakkudzpx", model.certificateSignerResourceId());
        Assertions.assertEquals(BooleanEnum.TRUE, model.certificateSelfSigned());
        Assertions.assertEquals("plmag", model.auditComment());
        Assertions.assertEquals("cyohpfkyrkdbd", model.description());
        Assertions.assertEquals("ogsjkmnwqjno", model.etag());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        CertificateObjectLocalRulestackResourceInner model =
            new CertificateObjectLocalRulestackResourceInner()
                .withCertificateSignerResourceId("vpayakkudzpx")
                .withCertificateSelfSigned(BooleanEnum.TRUE)
                .withAuditComment("plmag")
                .withDescription("cyohpfkyrkdbd")
                .withEtag("ogsjkmnwqjno");
        model = BinaryData.fromObject(model).toObject(CertificateObjectLocalRulestackResourceInner.class);
        Assertions.assertEquals("vpayakkudzpx", model.certificateSignerResourceId());
        Assertions.assertEquals(BooleanEnum.TRUE, model.certificateSelfSigned());
        Assertions.assertEquals("plmag", model.auditComment());
        Assertions.assertEquals("cyohpfkyrkdbd", model.description());
        Assertions.assertEquals("ogsjkmnwqjno", model.etag());
    }
}
