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

package com.azure.resourcemanager.avs.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.avs.fluent.models.ClusterInner;
import com.azure.resourcemanager.avs.models.Sku;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;

public final class ClusterInnerTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        ClusterInner model =
            BinaryData
                .fromString(
                    "{\"sku\":{\"name\":\"lvmezyvshxmzsbbz\"},\"properties\":{\"clusterSize\":1542879301,\"provisioningState\":\"Succeeded\",\"clusterId\":2011180934,\"hosts\":[\"rvjx\"]},\"id\":\"jnspydp\",\"name\":\"koen\",\"type\":\"ou\"}")
                .toObject(ClusterInner.class);
        Assertions.assertEquals("lvmezyvshxmzsbbz", model.sku().name());
        Assertions.assertEquals(1542879301, model.clusterSize());
        Assertions.assertEquals("rvjx", model.hosts().get(0));
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        ClusterInner model =
            new ClusterInner()
                .withSku(new Sku().withName("lvmezyvshxmzsbbz"))
                .withClusterSize(1542879301)
                .withHosts(Arrays.asList("rvjx"));
        model = BinaryData.fromObject(model).toObject(ClusterInner.class);
        Assertions.assertEquals("lvmezyvshxmzsbbz", model.sku().name());
        Assertions.assertEquals(1542879301, model.clusterSize());
        Assertions.assertEquals("rvjx", model.hosts().get(0));
    }
}
