// 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.containers.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.hdinsight.containers.fluent.models.ClusterVersionProperties;
import org.junit.jupiter.api.Assertions;

public final class ClusterVersionPropertiesTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        ClusterVersionProperties model =
            BinaryData
                .fromString(
                    "{\"clusterType\":\"fk\",\"clusterVersion\":\"vsexsowuelu\",\"ossVersion\":\"hahhxvrhmzkwpj\",\"clusterPoolVersion\":\"wspughftqsxhqx\",\"isPreview\":true,\"components\":[{\"name\":\"dxdigr\",\"version\":\"uufzdmsyqtfihw\"},{\"name\":\"otzi\",\"version\":\"amvpphoszqzudph\"},{\"name\":\"mvdk\",\"version\":\"ynwcvtbv\"}]}")
                .toObject(ClusterVersionProperties.class);
        Assertions.assertEquals("fk", model.clusterType());
        Assertions.assertEquals("vsexsowuelu", model.clusterVersion());
        Assertions.assertEquals("hahhxvrhmzkwpj", model.ossVersion());
        Assertions.assertEquals("wspughftqsxhqx", model.clusterPoolVersion());
        Assertions.assertEquals(true, model.isPreview());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        ClusterVersionProperties model =
            new ClusterVersionProperties()
                .withClusterType("fk")
                .withClusterVersion("vsexsowuelu")
                .withOssVersion("hahhxvrhmzkwpj")
                .withClusterPoolVersion("wspughftqsxhqx")
                .withIsPreview(true);
        model = BinaryData.fromObject(model).toObject(ClusterVersionProperties.class);
        Assertions.assertEquals("fk", model.clusterType());
        Assertions.assertEquals("vsexsowuelu", model.clusterVersion());
        Assertions.assertEquals("hahhxvrhmzkwpj", model.ossVersion());
        Assertions.assertEquals("wspughftqsxhqx", model.clusterPoolVersion());
        Assertions.assertEquals(true, model.isPreview());
    }
}
