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

package com.azure.resourcemanager.imagebuilder.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.imagebuilder.models.ImageTemplateVmProfile;
import com.azure.resourcemanager.imagebuilder.models.VirtualNetworkConfig;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;

public final class ImageTemplateVmProfileTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        ImageTemplateVmProfile model =
            BinaryData
                .fromString(
                    "{\"vmSize\":\"wjzrnfygxgisp\",\"osDiskSizeGB\":761437116,\"userAssignedIdentities\":[\"fkufublj\",\"fxqeof\",\"aeqjhqjbasvms\"],\"vnetConfig\":{\"subnetId\":\"ulngsntn\",\"proxyVmSize\":\"bkzgcwrwclx\"}}")
                .toObject(ImageTemplateVmProfile.class);
        Assertions.assertEquals("wjzrnfygxgisp", model.vmSize());
        Assertions.assertEquals(761437116, model.osDiskSizeGB());
        Assertions.assertEquals("fkufublj", model.userAssignedIdentities().get(0));
        Assertions.assertEquals("ulngsntn", model.vnetConfig().subnetId());
        Assertions.assertEquals("bkzgcwrwclx", model.vnetConfig().proxyVmSize());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        ImageTemplateVmProfile model =
            new ImageTemplateVmProfile()
                .withVmSize("wjzrnfygxgisp")
                .withOsDiskSizeGB(761437116)
                .withUserAssignedIdentities(Arrays.asList("fkufublj", "fxqeof", "aeqjhqjbasvms"))
                .withVnetConfig(new VirtualNetworkConfig().withSubnetId("ulngsntn").withProxyVmSize("bkzgcwrwclx"));
        model = BinaryData.fromObject(model).toObject(ImageTemplateVmProfile.class);
        Assertions.assertEquals("wjzrnfygxgisp", model.vmSize());
        Assertions.assertEquals(761437116, model.osDiskSizeGB());
        Assertions.assertEquals("fkufublj", model.userAssignedIdentities().get(0));
        Assertions.assertEquals("ulngsntn", model.vnetConfig().subnetId());
        Assertions.assertEquals("bkzgcwrwclx", model.vnetConfig().proxyVmSize());
    }
}
