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

public final class AzureVmWorkloadSapAseDatabaseWorkloadItemTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        AzureVmWorkloadSapAseDatabaseWorkloadItem model =
            BinaryData
                .fromString(
                    "{\"workloadItemType\":\"SAPAseDatabase\",\"parentName\":\"ujdjltymkmvg\",\"serverName\":\"hywartspph\",\"isAutoProtectable\":true,\"subinquireditemcount\":1302064813,\"subWorkloadItemCount\":1788200437,\"backupManagementType\":\"ssjpemmucf\",\"workloadType\":\"i\",\"friendlyName\":\"flrmymyi\",\"protectionState\":\"Protecting\"}")
                .toObject(AzureVmWorkloadSapAseDatabaseWorkloadItem.class);
        Assertions.assertEquals("ssjpemmucf", model.backupManagementType());
        Assertions.assertEquals("i", model.workloadType());
        Assertions.assertEquals("flrmymyi", model.friendlyName());
        Assertions.assertEquals(ProtectionStatus.PROTECTING, model.protectionState());
        Assertions.assertEquals("ujdjltymkmvg", model.parentName());
        Assertions.assertEquals("hywartspph", model.serverName());
        Assertions.assertEquals(true, model.isAutoProtectable());
        Assertions.assertEquals(1302064813, model.subinquireditemcount());
        Assertions.assertEquals(1788200437, model.subWorkloadItemCount());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        AzureVmWorkloadSapAseDatabaseWorkloadItem model =
            new AzureVmWorkloadSapAseDatabaseWorkloadItem()
                .withBackupManagementType("ssjpemmucf")
                .withWorkloadType("i")
                .withFriendlyName("flrmymyi")
                .withProtectionState(ProtectionStatus.PROTECTING)
                .withParentName("ujdjltymkmvg")
                .withServerName("hywartspph")
                .withIsAutoProtectable(true)
                .withSubinquireditemcount(1302064813)
                .withSubWorkloadItemCount(1788200437);
        model = BinaryData.fromObject(model).toObject(AzureVmWorkloadSapAseDatabaseWorkloadItem.class);
        Assertions.assertEquals("ssjpemmucf", model.backupManagementType());
        Assertions.assertEquals("i", model.workloadType());
        Assertions.assertEquals("flrmymyi", model.friendlyName());
        Assertions.assertEquals(ProtectionStatus.PROTECTING, model.protectionState());
        Assertions.assertEquals("ujdjltymkmvg", model.parentName());
        Assertions.assertEquals("hywartspph", model.serverName());
        Assertions.assertEquals(true, model.isAutoProtectable());
        Assertions.assertEquals(1302064813, model.subinquireditemcount());
        Assertions.assertEquals(1788200437, model.subWorkloadItemCount());
    }
}
