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

package com.azure.resourcemanager.recoveryservicesbackup.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.recoveryservicesbackup.models.AcquireStorageAccountLock;
import com.azure.resourcemanager.recoveryservicesbackup.models.AzureStorageContainer;
import com.azure.resourcemanager.recoveryservicesbackup.models.BackupManagementType;
import org.junit.jupiter.api.Assertions;

public final class AzureStorageContainerTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        AzureStorageContainer model =
            BinaryData
                .fromString(
                    "{\"containerType\":\"StorageContainer\",\"sourceResourceId\":\"kondcb\",\"storageAccountVersion\":\"imuvqejosovyrrl\",\"resourceGroup\":\"esi\",\"protectedItemCount\":6194571667792975344,\"acquireStorageAccountLock\":\"Acquire\",\"friendlyName\":\"obbpihehc\",\"backupManagementType\":\"AzureStorage\",\"registrationStatus\":\"mrqbrjbbmpxdlv\",\"healthStatus\":\"frexcrseqw\",\"protectableObjectType\":\"s\"}")
                .toObject(AzureStorageContainer.class);
        Assertions.assertEquals("obbpihehc", model.friendlyName());
        Assertions.assertEquals(BackupManagementType.AZURE_STORAGE, model.backupManagementType());
        Assertions.assertEquals("mrqbrjbbmpxdlv", model.registrationStatus());
        Assertions.assertEquals("frexcrseqw", model.healthStatus());
        Assertions.assertEquals("s", model.protectableObjectType());
        Assertions.assertEquals("kondcb", model.sourceResourceId());
        Assertions.assertEquals("imuvqejosovyrrl", model.storageAccountVersion());
        Assertions.assertEquals("esi", model.resourceGroup());
        Assertions.assertEquals(6194571667792975344L, model.protectedItemCount());
        Assertions.assertEquals(AcquireStorageAccountLock.ACQUIRE, model.acquireStorageAccountLock());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        AzureStorageContainer model =
            new AzureStorageContainer()
                .withFriendlyName("obbpihehc")
                .withBackupManagementType(BackupManagementType.AZURE_STORAGE)
                .withRegistrationStatus("mrqbrjbbmpxdlv")
                .withHealthStatus("frexcrseqw")
                .withProtectableObjectType("s")
                .withSourceResourceId("kondcb")
                .withStorageAccountVersion("imuvqejosovyrrl")
                .withResourceGroup("esi")
                .withProtectedItemCount(6194571667792975344L)
                .withAcquireStorageAccountLock(AcquireStorageAccountLock.ACQUIRE);
        model = BinaryData.fromObject(model).toObject(AzureStorageContainer.class);
        Assertions.assertEquals("obbpihehc", model.friendlyName());
        Assertions.assertEquals(BackupManagementType.AZURE_STORAGE, model.backupManagementType());
        Assertions.assertEquals("mrqbrjbbmpxdlv", model.registrationStatus());
        Assertions.assertEquals("frexcrseqw", model.healthStatus());
        Assertions.assertEquals("s", model.protectableObjectType());
        Assertions.assertEquals("kondcb", model.sourceResourceId());
        Assertions.assertEquals("imuvqejosovyrrl", model.storageAccountVersion());
        Assertions.assertEquals("esi", model.resourceGroup());
        Assertions.assertEquals(6194571667792975344L, model.protectedItemCount());
        Assertions.assertEquals(AcquireStorageAccountLock.ACQUIRE, model.acquireStorageAccountLock());
    }
}
