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

package com.azure.resourcemanager.iothub.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.iothub.models.CertificateProperties;
import org.junit.jupiter.api.Assertions;

public final class CertificatePropertiesTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        CertificateProperties model =
            BinaryData
                .fromString(
                    "{\"subject\":\"dckcbc\",\"expiry\":\"Thu, 29 Jul 2021 04:12:00"
                        + " GMT\",\"thumbprint\":\"jxgciqibrh\",\"isVerified\":true,\"created\":\"Tue, 01 Jun 2021"
                        + " 12:21:20 GMT\",\"updated\":\"Thu, 04 Feb 2021 15:03:28"
                        + " GMT\",\"certificate\":\"zoymibmrqyibahw\"}")
                .toObject(CertificateProperties.class);
        Assertions.assertEquals(true, model.isVerified());
        Assertions.assertEquals("zoymibmrqyibahw", model.certificate());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        CertificateProperties model =
            new CertificateProperties().withIsVerified(true).withCertificate("zoymibmrqyibahw");
        model = BinaryData.fromObject(model).toObject(CertificateProperties.class);
        Assertions.assertEquals(true, model.isVerified());
        Assertions.assertEquals("zoymibmrqyibahw", model.certificate());
    }
}
