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

public final class AzureVmWorkloadSapHanaDatabaseWorkloadItemTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        AzureVmWorkloadSapHanaDatabaseWorkloadItem model =
            BinaryData
                .fromString(
                    "{\"workloadItemType\":\"SAPHanaDatabase\",\"parentName\":\"phmgtvljvrcmyfq\",\"serverName\":\"gxhnpomyqwcabv\",\"isAutoProtectable\":false,\"subinquireditemcount\":1791320619,\"subWorkloadItemCount\":637099772,\"backupManagementType\":\"swlpaugmrmfj\",\"workloadType\":\"xwtoaukhfkvc\",\"friendlyName\":\"izmoaeds\",\"protectionState\":\"ProtectionFailed\"}")
                .toObject(AzureVmWorkloadSapHanaDatabaseWorkloadItem.class);
        Assertions.assertEquals("swlpaugmrmfj", model.backupManagementType());
        Assertions.assertEquals("xwtoaukhfkvc", model.workloadType());
        Assertions.assertEquals("izmoaeds", model.friendlyName());
        Assertions.assertEquals(ProtectionStatus.PROTECTION_FAILED, model.protectionState());
        Assertions.assertEquals("phmgtvljvrcmyfq", model.parentName());
        Assertions.assertEquals("gxhnpomyqwcabv", model.serverName());
        Assertions.assertEquals(false, model.isAutoProtectable());
        Assertions.assertEquals(1791320619, model.subinquireditemcount());
        Assertions.assertEquals(637099772, model.subWorkloadItemCount());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        AzureVmWorkloadSapHanaDatabaseWorkloadItem model =
            new AzureVmWorkloadSapHanaDatabaseWorkloadItem()
                .withBackupManagementType("swlpaugmrmfj")
                .withWorkloadType("xwtoaukhfkvc")
                .withFriendlyName("izmoaeds")
                .withProtectionState(ProtectionStatus.PROTECTION_FAILED)
                .withParentName("phmgtvljvrcmyfq")
                .withServerName("gxhnpomyqwcabv")
                .withIsAutoProtectable(false)
                .withSubinquireditemcount(1791320619)
                .withSubWorkloadItemCount(637099772);
        model = BinaryData.fromObject(model).toObject(AzureVmWorkloadSapHanaDatabaseWorkloadItem.class);
        Assertions.assertEquals("swlpaugmrmfj", model.backupManagementType());
        Assertions.assertEquals("xwtoaukhfkvc", model.workloadType());
        Assertions.assertEquals("izmoaeds", model.friendlyName());
        Assertions.assertEquals(ProtectionStatus.PROTECTION_FAILED, model.protectionState());
        Assertions.assertEquals("phmgtvljvrcmyfq", model.parentName());
        Assertions.assertEquals("gxhnpomyqwcabv", model.serverName());
        Assertions.assertEquals(false, model.isAutoProtectable());
        Assertions.assertEquals(1791320619, model.subinquireditemcount());
        Assertions.assertEquals(637099772, model.subWorkloadItemCount());
    }
}
