// 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.models.CommonClusterProperties;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;

public final class CommonClusterPropertiesTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        CommonClusterProperties model =
            BinaryData
                .fromString(
                    "{\"clusterSize\":1271650742,\"provisioningState\":\"Canceled\",\"clusterId\":1239569697,\"hosts\":[\"uosvmkfssxqukk\"]}")
                .toObject(CommonClusterProperties.class);
        Assertions.assertEquals(1271650742, model.clusterSize());
        Assertions.assertEquals("uosvmkfssxqukk", model.hosts().get(0));
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        CommonClusterProperties model =
            new CommonClusterProperties().withClusterSize(1271650742).withHosts(Arrays.asList("uosvmkfssxqukk"));
        model = BinaryData.fromObject(model).toObject(CommonClusterProperties.class);
        Assertions.assertEquals(1271650742, model.clusterSize());
        Assertions.assertEquals("uosvmkfssxqukk", model.hosts().get(0));
    }
}
