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

public final class ClusterPropertiesTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        ClusterProperties model =
            BinaryData
                .fromString(
                    "{\"clusterSize\":1110747875,\"provisioningState\":\"Cancelled\",\"clusterId\":1378070116,\"hosts\":[\"kbldngkpocipa\",\"yxoegukgjnp\",\"ucgygevqz\"]}")
                .toObject(ClusterProperties.class);
        Assertions.assertEquals(1110747875, model.clusterSize());
        Assertions.assertEquals("kbldngkpocipa", model.hosts().get(0));
    }

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