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

public final class ClusterUpdateTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        ClusterUpdate model =
            BinaryData
                .fromString(
                    "{\"properties\":{\"clusterSize\":561322525,\"hosts\":[\"bpizcdrqjsdpydn\",\"yhxdeoejzicwi\"]}}")
                .toObject(ClusterUpdate.class);
        Assertions.assertEquals(561322525, model.clusterSize());
        Assertions.assertEquals("bpizcdrqjsdpydn", model.hosts().get(0));
    }

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