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

package com.azure.resourcemanager.networkcloud.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.networkcloud.fluent.models.ClusterManagerProperties;
import com.azure.resourcemanager.networkcloud.models.ManagedResourceGroupConfiguration;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;

public final class ClusterManagerPropertiesTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        ClusterManagerProperties model =
            BinaryData
                .fromString(
                    "{\"analyticsWorkspaceId\":\"lyaxuc\",\"availabilityZones\":[\"qszf\",\"beypewrmjmw\"],\"clusterVersions\":[{\"supportExpiryDate\":\"kt\",\"targetClusterVersion\":\"senhwlrs\"},{\"supportExpiryDate\":\"rzpwvlqdqgbiq\",\"targetClusterVersion\":\"ihkaetcktvfc\"},{\"supportExpiryDate\":\"fsnkymuctq\",\"targetClusterVersion\":\"fbebrjcxer\"}],\"detailedStatus\":\"Updating\",\"detailedStatusMessage\":\"tttxfvjrb\",\"fabricControllerId\":\"rp\",\"managedResourceGroupConfiguration\":{\"location\":\"pcyvahfnljkyqx\",\"name\":\"uujqgidokgjljyo\"},\"managerExtendedLocation\":{\"name\":\"vcltbgsncgh\",\"type\":\"jeszzhbijhtxfv\"},\"provisioningState\":\"Provisioning\",\"vmSize\":\"smx\"}")
                .toObject(ClusterManagerProperties.class);
        Assertions.assertEquals("lyaxuc", model.analyticsWorkspaceId());
        Assertions.assertEquals("qszf", model.availabilityZones().get(0));
        Assertions.assertEquals("rp", model.fabricControllerId());
        Assertions.assertEquals("pcyvahfnljkyqx", model.managedResourceGroupConfiguration().location());
        Assertions.assertEquals("uujqgidokgjljyo", model.managedResourceGroupConfiguration().name());
        Assertions.assertEquals("smx", model.vmSize());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        ClusterManagerProperties model =
            new ClusterManagerProperties()
                .withAnalyticsWorkspaceId("lyaxuc")
                .withAvailabilityZones(Arrays.asList("qszf", "beypewrmjmw"))
                .withFabricControllerId("rp")
                .withManagedResourceGroupConfiguration(
                    new ManagedResourceGroupConfiguration().withLocation("pcyvahfnljkyqx").withName("uujqgidokgjljyo"))
                .withVmSize("smx");
        model = BinaryData.fromObject(model).toObject(ClusterManagerProperties.class);
        Assertions.assertEquals("lyaxuc", model.analyticsWorkspaceId());
        Assertions.assertEquals("qszf", model.availabilityZones().get(0));
        Assertions.assertEquals("rp", model.fabricControllerId());
        Assertions.assertEquals("pcyvahfnljkyqx", model.managedResourceGroupConfiguration().location());
        Assertions.assertEquals("uujqgidokgjljyo", model.managedResourceGroupConfiguration().name());
        Assertions.assertEquals("smx", model.vmSize());
    }
}
