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

package com.azure.resourcemanager.postgresqlflexibleserver.generated;

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

public final class ConfigurationListResultTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        ConfigurationListResult model =
            BinaryData
                .fromString(
                    "{\"value\":[{\"properties\":{\"value\":\"bl\",\"description\":\"gpbtoqcjmklj\",\"defaultValue\":\"bqidtqaj\",\"dataType\":\"Integer\",\"allowedValues\":\"pku\",\"source\":\"krlkhbzhfepg\",\"isDynamicConfig\":false,\"isReadOnly\":true,\"isConfigPendingRestart\":false,\"unit\":\"c\",\"documentationLink\":\"c\"},\"id\":\"ierhhbcsglummaj\",\"name\":\"j\",\"type\":\"odxobnbdxkqpxok\"}],\"nextLink\":\"ionpimexg\"}")
                .toObject(ConfigurationListResult.class);
        Assertions.assertEquals("bl", model.value().get(0).value());
        Assertions.assertEquals("krlkhbzhfepg", model.value().get(0).source());
        Assertions.assertEquals("ionpimexg", model.nextLink());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        ConfigurationListResult model =
            new ConfigurationListResult()
                .withValue(Arrays.asList(new ConfigurationInner().withValue("bl").withSource("krlkhbzhfepg")))
                .withNextLink("ionpimexg");
        model = BinaryData.fromObject(model).toObject(ConfigurationListResult.class);
        Assertions.assertEquals("bl", model.value().get(0).value());
        Assertions.assertEquals("krlkhbzhfepg", model.value().get(0).source());
        Assertions.assertEquals("ionpimexg", model.nextLink());
    }
}
