// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.resourcemanager.workloads.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.workloads.models.DeployerVmPackages;
import com.azure.resourcemanager.workloads.models.DeploymentWithOSConfiguration;
import com.azure.resourcemanager.workloads.models.InfrastructureConfiguration;
import com.azure.resourcemanager.workloads.models.OsSapConfiguration;
import com.azure.resourcemanager.workloads.models.SoftwareConfiguration;
import org.junit.jupiter.api.Assertions;

public final class DeploymentWithOSConfigurationTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        DeploymentWithOSConfiguration model =
            BinaryData
                .fromString(
                    "{\"configurationType\":\"DeploymentWithOSConfig\",\"appLocation\":\"dxtqmieoxo\",\"infrastructureConfiguration\":{\"deploymentType\":\"InfrastructureConfiguration\",\"appResourceGroup\":\"gufhyaomtbg\"},\"softwareConfiguration\":{\"softwareInstallationType\":\"SoftwareConfiguration\"},\"osSapConfiguration\":{\"deployerVmPackages\":{\"url\":\"rvk\",\"storageAccountId\":\"ovjzhpjbibgjmfx\"},\"sapFqdn\":\"vfcluyovwxnbkfe\"}}")
                .toObject(DeploymentWithOSConfiguration.class);
        Assertions.assertEquals("dxtqmieoxo", model.appLocation());
        Assertions.assertEquals("gufhyaomtbg", model.infrastructureConfiguration().appResourceGroup());
        Assertions.assertEquals("rvk", model.osSapConfiguration().deployerVmPackages().url());
        Assertions.assertEquals("ovjzhpjbibgjmfx", model.osSapConfiguration().deployerVmPackages().storageAccountId());
        Assertions.assertEquals("vfcluyovwxnbkfe", model.osSapConfiguration().sapFqdn());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        DeploymentWithOSConfiguration model =
            new DeploymentWithOSConfiguration()
                .withAppLocation("dxtqmieoxo")
                .withInfrastructureConfiguration(new InfrastructureConfiguration().withAppResourceGroup("gufhyaomtbg"))
                .withSoftwareConfiguration(new SoftwareConfiguration())
                .withOsSapConfiguration(
                    new OsSapConfiguration()
                        .withDeployerVmPackages(
                            new DeployerVmPackages().withUrl("rvk").withStorageAccountId("ovjzhpjbibgjmfx"))
                        .withSapFqdn("vfcluyovwxnbkfe"));
        model = BinaryData.fromObject(model).toObject(DeploymentWithOSConfiguration.class);
        Assertions.assertEquals("dxtqmieoxo", model.appLocation());
        Assertions.assertEquals("gufhyaomtbg", model.infrastructureConfiguration().appResourceGroup());
        Assertions.assertEquals("rvk", model.osSapConfiguration().deployerVmPackages().url());
        Assertions.assertEquals("ovjzhpjbibgjmfx", model.osSapConfiguration().deployerVmPackages().storageAccountId());
        Assertions.assertEquals("vfcluyovwxnbkfe", model.osSapConfiguration().sapFqdn());
    }
}
