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

package com.azure.resourcemanager.storageimportexport.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.storageimportexport.models.EncryptionKekType;
import com.azure.resourcemanager.storageimportexport.models.EncryptionKeyDetails;
import org.junit.jupiter.api.Assertions;

public final class EncryptionKeyDetailsTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        EncryptionKeyDetails model =
            BinaryData
                .fromString("{\"kekType\":\"MicrosoftManaged\",\"kekUrl\":\"hbzhfepg\",\"kekVaultResourceID\":\"qex\"}")
                .toObject(EncryptionKeyDetails.class);
        Assertions.assertEquals(EncryptionKekType.MICROSOFT_MANAGED, model.kekType());
        Assertions.assertEquals("hbzhfepg", model.kekUrl());
        Assertions.assertEquals("qex", model.kekVaultResourceId());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        EncryptionKeyDetails model =
            new EncryptionKeyDetails()
                .withKekType(EncryptionKekType.MICROSOFT_MANAGED)
                .withKekUrl("hbzhfepg")
                .withKekVaultResourceId("qex");
        model = BinaryData.fromObject(model).toObject(EncryptionKeyDetails.class);
        Assertions.assertEquals(EncryptionKekType.MICROSOFT_MANAGED, model.kekType());
        Assertions.assertEquals("hbzhfepg", model.kekUrl());
        Assertions.assertEquals("qex", model.kekVaultResourceId());
    }
}
