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

package com.azure.resourcemanager.databoxedge.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.databoxedge.models.AsymmetricEncryptedSecret;
import com.azure.resourcemanager.databoxedge.models.EncryptionAlgorithm;
import org.junit.jupiter.api.Assertions;

public final class AsymmetricEncryptedSecretTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        AsymmetricEncryptedSecret model =
            BinaryData
                .fromString(
                    "{\"value\":\"vjfdx\",\"encryptionCertThumbprint\":\"vetvt\",\"encryptionAlgorithm\":\"RSAES_PKCS1_v_1_5\"}")
                .toObject(AsymmetricEncryptedSecret.class);
        Assertions.assertEquals("vjfdx", model.value());
        Assertions.assertEquals("vetvt", model.encryptionCertThumbprint());
        Assertions.assertEquals(EncryptionAlgorithm.RSAES_PKCS1_V_1_5, model.encryptionAlgorithm());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        AsymmetricEncryptedSecret model =
            new AsymmetricEncryptedSecret()
                .withValue("vjfdx")
                .withEncryptionCertThumbprint("vetvt")
                .withEncryptionAlgorithm(EncryptionAlgorithm.RSAES_PKCS1_V_1_5);
        model = BinaryData.fromObject(model).toObject(AsymmetricEncryptedSecret.class);
        Assertions.assertEquals("vjfdx", model.value());
        Assertions.assertEquals("vetvt", model.encryptionCertThumbprint());
        Assertions.assertEquals(EncryptionAlgorithm.RSAES_PKCS1_V_1_5, model.encryptionAlgorithm());
    }
}
