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

package com.azure.resourcemanager.hybridkubernetes.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.hybridkubernetes.models.ConnectedClusterIdentity;
import com.azure.resourcemanager.hybridkubernetes.models.ResourceIdentityType;
import org.junit.jupiter.api.Assertions;

public final class ConnectedClusterIdentityTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        ConnectedClusterIdentity model =
            BinaryData
                .fromString("{\"principalId\":\"sybbejhph\",\"tenantId\":\"cmsxaobhdxbm\",\"type\":\"SystemAssigned\"}")
                .toObject(ConnectedClusterIdentity.class);
        Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED, model.type());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        ConnectedClusterIdentity model = new ConnectedClusterIdentity().withType(ResourceIdentityType.SYSTEM_ASSIGNED);
        model = BinaryData.fromObject(model).toObject(ConnectedClusterIdentity.class);
        Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED, model.type());
    }
}
