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

package com.azure.resourcemanager.hdinsight.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.hdinsight.models.FilterMode;
import com.azure.resourcemanager.hdinsight.models.OSType;
import com.azure.resourcemanager.hdinsight.models.VmSizeCompatibilityFilterV2;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;

public final class VmSizeCompatibilityFilterV2Tests {
    @Test
    public void testDeserialize() {
        VmSizeCompatibilityFilterV2 model =
            BinaryData
                .fromString(
                    "{\"filterMode\":\"Exclude\",\"regions\":[\"jxdxrbuukz\"],\"clusterFlavors\":[\"wyhmlw\",\"aztz\"],\"nodeTypes\":[\"ncckw\"],\"clusterVersions\":[\"qwhxxbuyqaxzfeqz\",\"ppriol\",\"or\",\"altol\"],\"osType\":[\"Linux\",\"Windows\",\"Linux\"],\"vmSizes\":[\"wcsdbnwdcfhucq\",\"pfuvglsbjjca\",\"vxb\",\"t\"],\"espApplied\":\"dut\",\"computeIsolationSupported\":\"ormrlxqtvcofudfl\"}")
                .toObject(VmSizeCompatibilityFilterV2.class);
        Assertions.assertEquals(FilterMode.EXCLUDE, model.filterMode());
        Assertions.assertEquals("jxdxrbuukz", model.regions().get(0));
        Assertions.assertEquals("wyhmlw", model.clusterFlavors().get(0));
        Assertions.assertEquals("ncckw", model.nodeTypes().get(0));
        Assertions.assertEquals("qwhxxbuyqaxzfeqz", model.clusterVersions().get(0));
        Assertions.assertEquals(OSType.LINUX, model.osType().get(0));
        Assertions.assertEquals("wcsdbnwdcfhucq", model.vmSizes().get(0));
        Assertions.assertEquals("dut", model.espApplied());
        Assertions.assertEquals("ormrlxqtvcofudfl", model.computeIsolationSupported());
    }

    @Test
    public void testSerialize() {
        VmSizeCompatibilityFilterV2 model =
            new VmSizeCompatibilityFilterV2()
                .withFilterMode(FilterMode.EXCLUDE)
                .withRegions(Arrays.asList("jxdxrbuukz"))
                .withClusterFlavors(Arrays.asList("wyhmlw", "aztz"))
                .withNodeTypes(Arrays.asList("ncckw"))
                .withClusterVersions(Arrays.asList("qwhxxbuyqaxzfeqz", "ppriol", "or", "altol"))
                .withOsType(Arrays.asList(OSType.LINUX, OSType.WINDOWS, OSType.LINUX))
                .withVmSizes(Arrays.asList("wcsdbnwdcfhucq", "pfuvglsbjjca", "vxb", "t"))
                .withEspApplied("dut")
                .withComputeIsolationSupported("ormrlxqtvcofudfl");
        model = BinaryData.fromObject(model).toObject(VmSizeCompatibilityFilterV2.class);
        Assertions.assertEquals(FilterMode.EXCLUDE, model.filterMode());
        Assertions.assertEquals("jxdxrbuukz", model.regions().get(0));
        Assertions.assertEquals("wyhmlw", model.clusterFlavors().get(0));
        Assertions.assertEquals("ncckw", model.nodeTypes().get(0));
        Assertions.assertEquals("qwhxxbuyqaxzfeqz", model.clusterVersions().get(0));
        Assertions.assertEquals(OSType.LINUX, model.osType().get(0));
        Assertions.assertEquals("wcsdbnwdcfhucq", model.vmSizes().get(0));
        Assertions.assertEquals("dut", model.espApplied());
        Assertions.assertEquals("ormrlxqtvcofudfl", model.computeIsolationSupported());
    }
}
