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

public final class AzureVmWorkloadSapHanaSystemWorkloadItemTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        AzureVmWorkloadSapHanaSystemWorkloadItem model =
            BinaryData
                .fromString(
                    "{\"workloadItemType\":\"SAPHanaSystem\",\"parentName\":\"csypobkdqzrdzsyl\",\"serverName\":\"lgtrczzy\",\"isAutoProtectable\":false,\"subinquireditemcount\":367147351,\"subWorkloadItemCount\":1633572921,\"backupManagementType\":\"vuaurk\",\"workloadType\":\"ci\",\"friendlyName\":\"defxrdc\",\"protectionState\":\"Invalid\"}")
                .toObject(AzureVmWorkloadSapHanaSystemWorkloadItem.class);
        Assertions.assertEquals("vuaurk", model.backupManagementType());
        Assertions.assertEquals("ci", model.workloadType());
        Assertions.assertEquals("defxrdc", model.friendlyName());
        Assertions.assertEquals(ProtectionStatus.INVALID, model.protectionState());
        Assertions.assertEquals("csypobkdqzrdzsyl", model.parentName());
        Assertions.assertEquals("lgtrczzy", model.serverName());
        Assertions.assertEquals(false, model.isAutoProtectable());
        Assertions.assertEquals(367147351, model.subinquireditemcount());
        Assertions.assertEquals(1633572921, model.subWorkloadItemCount());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        AzureVmWorkloadSapHanaSystemWorkloadItem model =
            new AzureVmWorkloadSapHanaSystemWorkloadItem()
                .withBackupManagementType("vuaurk")
                .withWorkloadType("ci")
                .withFriendlyName("defxrdc")
                .withProtectionState(ProtectionStatus.INVALID)
                .withParentName("csypobkdqzrdzsyl")
                .withServerName("lgtrczzy")
                .withIsAutoProtectable(false)
                .withSubinquireditemcount(367147351)
                .withSubWorkloadItemCount(1633572921);
        model = BinaryData.fromObject(model).toObject(AzureVmWorkloadSapHanaSystemWorkloadItem.class);
        Assertions.assertEquals("vuaurk", model.backupManagementType());
        Assertions.assertEquals("ci", model.workloadType());
        Assertions.assertEquals("defxrdc", model.friendlyName());
        Assertions.assertEquals(ProtectionStatus.INVALID, model.protectionState());
        Assertions.assertEquals("csypobkdqzrdzsyl", model.parentName());
        Assertions.assertEquals("lgtrczzy", model.serverName());
        Assertions.assertEquals(false, model.isAutoProtectable());
        Assertions.assertEquals(367147351, model.subinquireditemcount());
        Assertions.assertEquals(1633572921, model.subWorkloadItemCount());
    }
}
