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

package com.azure.resourcemanager.redisenterprise.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.redisenterprise.models.ClusterPropertiesEncryptionCustomerManagedKeyEncryptionKeyIdentity;
import com.azure.resourcemanager.redisenterprise.models.CmkIdentityType;
import org.junit.jupiter.api.Assertions;

public final class ClusterPropertiesEncryptionCustomerManagedKeyEncryptionKeyIdentityTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        ClusterPropertiesEncryptionCustomerManagedKeyEncryptionKeyIdentity model =
            BinaryData
                .fromString(
                    "{\"userAssignedIdentityResourceId\":\"ininmay\",\"identityType\":\"systemAssignedIdentity\"}")
                .toObject(ClusterPropertiesEncryptionCustomerManagedKeyEncryptionKeyIdentity.class);
        Assertions.assertEquals("ininmay", model.userAssignedIdentityResourceId());
        Assertions.assertEquals(CmkIdentityType.SYSTEM_ASSIGNED_IDENTITY, model.identityType());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        ClusterPropertiesEncryptionCustomerManagedKeyEncryptionKeyIdentity model =
            new ClusterPropertiesEncryptionCustomerManagedKeyEncryptionKeyIdentity()
                .withUserAssignedIdentityResourceId("ininmay")
                .withIdentityType(CmkIdentityType.SYSTEM_ASSIGNED_IDENTITY);
        model =
            BinaryData
                .fromObject(model)
                .toObject(ClusterPropertiesEncryptionCustomerManagedKeyEncryptionKeyIdentity.class);
        Assertions.assertEquals("ininmay", model.userAssignedIdentityResourceId());
        Assertions.assertEquals(CmkIdentityType.SYSTEM_ASSIGNED_IDENTITY, model.identityType());
    }
}
