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

package com.azure.resourcemanager.machinelearning.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.machinelearning.models.AutoPauseProperties;
import com.azure.resourcemanager.machinelearning.models.AutoScaleProperties;
import com.azure.resourcemanager.machinelearning.models.SynapseSparkProperties;
import org.junit.jupiter.api.Assertions;

public final class SynapseSparkPropertiesTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        SynapseSparkProperties model =
            BinaryData
                .fromString(
                    "{\"autoScaleProperties\":{\"minNodeCount\":1954145446,\"enabled\":true,\"maxNodeCount\":1674537674},\"autoPauseProperties\":{\"delayInMinutes\":1052407004,\"enabled\":true},\"sparkVersion\":\"ojpslsvjgpliufi\",\"nodeCount\":1125182676,\"nodeSize\":\"xqvapcohh\",\"nodeSizeFamily\":\"cqpqojxcxzrzdc\",\"subscriptionId\":\"zbenribc\",\"resourceGroup\":\"etzqd\",\"workspaceName\":\"jwfljhznamtua\",\"poolName\":\"zwcjjncqtj\"}")
                .toObject(SynapseSparkProperties.class);
        Assertions.assertEquals(1954145446, model.autoScaleProperties().minNodeCount());
        Assertions.assertEquals(true, model.autoScaleProperties().enabled());
        Assertions.assertEquals(1674537674, model.autoScaleProperties().maxNodeCount());
        Assertions.assertEquals(1052407004, model.autoPauseProperties().delayInMinutes());
        Assertions.assertEquals(true, model.autoPauseProperties().enabled());
        Assertions.assertEquals("ojpslsvjgpliufi", model.sparkVersion());
        Assertions.assertEquals(1125182676, model.nodeCount());
        Assertions.assertEquals("xqvapcohh", model.nodeSize());
        Assertions.assertEquals("cqpqojxcxzrzdc", model.nodeSizeFamily());
        Assertions.assertEquals("zbenribc", model.subscriptionId());
        Assertions.assertEquals("etzqd", model.resourceGroup());
        Assertions.assertEquals("jwfljhznamtua", model.workspaceName());
        Assertions.assertEquals("zwcjjncqtj", model.poolName());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        SynapseSparkProperties model =
            new SynapseSparkProperties()
                .withAutoScaleProperties(
                    new AutoScaleProperties()
                        .withMinNodeCount(1954145446)
                        .withEnabled(true)
                        .withMaxNodeCount(1674537674))
                .withAutoPauseProperties(new AutoPauseProperties().withDelayInMinutes(1052407004).withEnabled(true))
                .withSparkVersion("ojpslsvjgpliufi")
                .withNodeCount(1125182676)
                .withNodeSize("xqvapcohh")
                .withNodeSizeFamily("cqpqojxcxzrzdc")
                .withSubscriptionId("zbenribc")
                .withResourceGroup("etzqd")
                .withWorkspaceName("jwfljhznamtua")
                .withPoolName("zwcjjncqtj");
        model = BinaryData.fromObject(model).toObject(SynapseSparkProperties.class);
        Assertions.assertEquals(1954145446, model.autoScaleProperties().minNodeCount());
        Assertions.assertEquals(true, model.autoScaleProperties().enabled());
        Assertions.assertEquals(1674537674, model.autoScaleProperties().maxNodeCount());
        Assertions.assertEquals(1052407004, model.autoPauseProperties().delayInMinutes());
        Assertions.assertEquals(true, model.autoPauseProperties().enabled());
        Assertions.assertEquals("ojpslsvjgpliufi", model.sparkVersion());
        Assertions.assertEquals(1125182676, model.nodeCount());
        Assertions.assertEquals("xqvapcohh", model.nodeSize());
        Assertions.assertEquals("cqpqojxcxzrzdc", model.nodeSizeFamily());
        Assertions.assertEquals("zbenribc", model.subscriptionId());
        Assertions.assertEquals("etzqd", model.resourceGroup());
        Assertions.assertEquals("jwfljhznamtua", model.workspaceName());
        Assertions.assertEquals("zwcjjncqtj", model.poolName());
    }
}
