// 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.fluent.models.CertificateDescriptionInner;
import com.azure.resourcemanager.iothub.models.CertificateProperties;
import org.junit.jupiter.api.Assertions;

public final class CertificateDescriptionInnerTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        CertificateDescriptionInner model =
            BinaryData
                .fromString(
                    "{\"properties\":{\"subject\":\"mond\",\"expiry\":\"Thu, 01 Apr 2021 23:21:50"
                        + " GMT\",\"thumbprint\":\"xvy\",\"isVerified\":false,\"created\":\"Fri, 01 Oct 2021 02:55:48"
                        + " GMT\",\"updated\":\"Mon, 25 Jan 2021 05:21:40"
                        + " GMT\",\"certificate\":\"whojvp\"},\"etag\":\"qgxy\",\"id\":\"mocmbqfqvmk\",\"name\":\"xozap\",\"type\":\"helxprglya\"}")
                .toObject(CertificateDescriptionInner.class);
        Assertions.assertEquals(false, model.properties().isVerified());
        Assertions.assertEquals("whojvp", model.properties().certificate());
    }

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