// 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.BackupManagementType;
import com.azure.resourcemanager.recoveryservicesbackup.models.ProtectionContainer;
import org.junit.jupiter.api.Assertions;

public final class ProtectionContainerTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        ProtectionContainer model =
            BinaryData
                .fromString(
                    "{\"containerType\":\"ProtectionContainer\",\"friendlyName\":\"axhexiilivp\",\"backupManagementType\":\"DPM\",\"registrationStatus\":\"r\",\"healthStatus\":\"d\",\"protectableObjectType\":\"axoruzfgsquy\"}")
                .toObject(ProtectionContainer.class);
        Assertions.assertEquals("axhexiilivp", model.friendlyName());
        Assertions.assertEquals(BackupManagementType.DPM, model.backupManagementType());
        Assertions.assertEquals("r", model.registrationStatus());
        Assertions.assertEquals("d", model.healthStatus());
        Assertions.assertEquals("axoruzfgsquy", model.protectableObjectType());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        ProtectionContainer model =
            new ProtectionContainer()
                .withFriendlyName("axhexiilivp")
                .withBackupManagementType(BackupManagementType.DPM)
                .withRegistrationStatus("r")
                .withHealthStatus("d")
                .withProtectableObjectType("axoruzfgsquy");
        model = BinaryData.fromObject(model).toObject(ProtectionContainer.class);
        Assertions.assertEquals("axhexiilivp", model.friendlyName());
        Assertions.assertEquals(BackupManagementType.DPM, model.backupManagementType());
        Assertions.assertEquals("r", model.registrationStatus());
        Assertions.assertEquals("d", model.healthStatus());
        Assertions.assertEquals("axoruzfgsquy", model.protectableObjectType());
    }
}
