// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.resourcemanager.servicefabric.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.servicefabric.models.CertificateDescription;
import com.azure.resourcemanager.servicefabric.models.StoreName;
import org.junit.jupiter.api.Assertions;

public final class CertificateDescriptionTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        CertificateDescription model =
            BinaryData
                .fromString(
                    "{\"thumbprint\":\"fpownoizhwlr\",\"thumbprintSecondary\":\"bqsoqijg\",\"x509StoreName\":\"TrustedPublisher\"}")
                .toObject(CertificateDescription.class);
        Assertions.assertEquals("fpownoizhwlr", model.thumbprint());
        Assertions.assertEquals("bqsoqijg", model.thumbprintSecondary());
        Assertions.assertEquals(StoreName.TRUSTED_PUBLISHER, model.x509StoreName());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        CertificateDescription model =
            new CertificateDescription()
                .withThumbprint("fpownoizhwlr")
                .withThumbprintSecondary("bqsoqijg")
                .withX509StoreName(StoreName.TRUSTED_PUBLISHER);
        model = BinaryData.fromObject(model).toObject(CertificateDescription.class);
        Assertions.assertEquals("fpownoizhwlr", model.thumbprint());
        Assertions.assertEquals("bqsoqijg", model.thumbprintSecondary());
        Assertions.assertEquals(StoreName.TRUSTED_PUBLISHER, model.x509StoreName());
    }
}
