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

public final class AzureVmWorkloadSapAseSystemWorkloadItemTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        AzureVmWorkloadSapAseSystemWorkloadItem model =
            BinaryData
                .fromString(
                    "{\"workloadItemType\":\"SAPAseSystem\",\"parentName\":\"gygqwah\",\"serverName\":\"ulwgniiprglvawuw\",\"isAutoProtectable\":false,\"subinquireditemcount\":2025886418,\"subWorkloadItemCount\":380241999,\"backupManagementType\":\"lsbbj\",\"workloadType\":\"cubkmi\",\"friendlyName\":\"xxkubvphavp\",\"protectionState\":\"Protected\"}")
                .toObject(AzureVmWorkloadSapAseSystemWorkloadItem.class);
        Assertions.assertEquals("lsbbj", model.backupManagementType());
        Assertions.assertEquals("cubkmi", model.workloadType());
        Assertions.assertEquals("xxkubvphavp", model.friendlyName());
        Assertions.assertEquals(ProtectionStatus.PROTECTED, model.protectionState());
        Assertions.assertEquals("gygqwah", model.parentName());
        Assertions.assertEquals("ulwgniiprglvawuw", model.serverName());
        Assertions.assertEquals(false, model.isAutoProtectable());
        Assertions.assertEquals(2025886418, model.subinquireditemcount());
        Assertions.assertEquals(380241999, model.subWorkloadItemCount());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        AzureVmWorkloadSapAseSystemWorkloadItem model =
            new AzureVmWorkloadSapAseSystemWorkloadItem()
                .withBackupManagementType("lsbbj")
                .withWorkloadType("cubkmi")
                .withFriendlyName("xxkubvphavp")
                .withProtectionState(ProtectionStatus.PROTECTED)
                .withParentName("gygqwah")
                .withServerName("ulwgniiprglvawuw")
                .withIsAutoProtectable(false)
                .withSubinquireditemcount(2025886418)
                .withSubWorkloadItemCount(380241999);
        model = BinaryData.fromObject(model).toObject(AzureVmWorkloadSapAseSystemWorkloadItem.class);
        Assertions.assertEquals("lsbbj", model.backupManagementType());
        Assertions.assertEquals("cubkmi", model.workloadType());
        Assertions.assertEquals("xxkubvphavp", model.friendlyName());
        Assertions.assertEquals(ProtectionStatus.PROTECTED, model.protectionState());
        Assertions.assertEquals("gygqwah", model.parentName());
        Assertions.assertEquals("ulwgniiprglvawuw", model.serverName());
        Assertions.assertEquals(false, model.isAutoProtectable());
        Assertions.assertEquals(2025886418, model.subinquireditemcount());
        Assertions.assertEquals(380241999, model.subWorkloadItemCount());
    }
}
