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

package com.azure.resourcemanager.cosmosdbforpostgresql.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.cosmosdbforpostgresql.fluent.models.ConfigurationInner;
import com.azure.resourcemanager.cosmosdbforpostgresql.models.ClusterConfigurationListResult;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;

public final class ClusterConfigurationListResultTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        ClusterConfigurationListResult model =
            BinaryData
                .fromString(
                    "{\"value\":[{\"properties\":{\"description\":\"tnwu\",\"dataType\":\"Numeric\",\"allowedValues\":\"zxufiz\",\"requiresRestart\":false,\"serverRoleGroupConfigurations\":[],\"provisioningState\":\"Canceled\"},\"id\":\"hr\",\"name\":\"idf\",\"type\":\"zwdzuh\"}],\"nextLink\":\"mwisdkfthwxmnt\"}")
                .toObject(ClusterConfigurationListResult.class);
        Assertions.assertEquals(false, model.value().get(0).requiresRestart());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        ClusterConfigurationListResult model =
            new ClusterConfigurationListResult()
                .withValue(
                    Arrays
                        .asList(
                            new ConfigurationInner()
                                .withRequiresRestart(false)
                                .withServerRoleGroupConfigurations(Arrays.asList())));
        model = BinaryData.fromObject(model).toObject(ClusterConfigurationListResult.class);
        Assertions.assertEquals(false, model.value().get(0).requiresRestart());
    }
}
