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

public final class CertificateObjectTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        CertificateObject model =
            BinaryData
                .fromString(
                    "{\"certificateSignerResourceId\":\"jybige\",\"certificateSelfSigned\":\"FALSE\",\"auditComment\":\"fbowskanyk\",\"description\":\"lcuiywgqywgndr\",\"etag\":\"nhzgpphrcgyn\",\"provisioningState\":\"Deleted\"}")
                .toObject(CertificateObject.class);
        Assertions.assertEquals("jybige", model.certificateSignerResourceId());
        Assertions.assertEquals(BooleanEnum.FALSE, model.certificateSelfSigned());
        Assertions.assertEquals("fbowskanyk", model.auditComment());
        Assertions.assertEquals("lcuiywgqywgndr", model.description());
        Assertions.assertEquals("nhzgpphrcgyn", model.etag());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        CertificateObject model =
            new CertificateObject()
                .withCertificateSignerResourceId("jybige")
                .withCertificateSelfSigned(BooleanEnum.FALSE)
                .withAuditComment("fbowskanyk")
                .withDescription("lcuiywgqywgndr")
                .withEtag("nhzgpphrcgyn");
        model = BinaryData.fromObject(model).toObject(CertificateObject.class);
        Assertions.assertEquals("jybige", model.certificateSignerResourceId());
        Assertions.assertEquals(BooleanEnum.FALSE, model.certificateSelfSigned());
        Assertions.assertEquals("fbowskanyk", model.auditComment());
        Assertions.assertEquals("lcuiywgqywgndr", model.description());
        Assertions.assertEquals("nhzgpphrcgyn", model.etag());
    }
}
