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

package com.azure.resourcemanager.mysqlflexibleserver.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.ConfigurationProperties;
import com.azure.resourcemanager.mysqlflexibleserver.models.ConfigurationSource;
import org.junit.jupiter.api.Assertions;

public final class ConfigurationPropertiesTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        ConfigurationProperties model =
            BinaryData
                .fromString(
                    "{\"value\":\"wjzrnfygxgisp\",\"currentValue\":\"vtz\",\"description\":\"ufubl\",\"documentationLink\":\"fxqeof\",\"defaultValue\":\"e\",\"dataType\":\"hqjbasvmsmj\",\"allowedValues\":\"lngsntnbybkzgcwr\",\"source\":\"user-override\",\"isReadOnly\":\"False\",\"isConfigPendingRestart\":\"False\",\"isDynamicConfig\":\"True\"}")
                .toObject(ConfigurationProperties.class);
        Assertions.assertEquals("wjzrnfygxgisp", model.value());
        Assertions.assertEquals("vtz", model.currentValue());
        Assertions.assertEquals(ConfigurationSource.USER_OVERRIDE, model.source());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        ConfigurationProperties model =
            new ConfigurationProperties()
                .withValue("wjzrnfygxgisp")
                .withCurrentValue("vtz")
                .withSource(ConfigurationSource.USER_OVERRIDE);
        model = BinaryData.fromObject(model).toObject(ConfigurationProperties.class);
        Assertions.assertEquals("wjzrnfygxgisp", model.value());
        Assertions.assertEquals("vtz", model.currentValue());
        Assertions.assertEquals(ConfigurationSource.USER_OVERRIDE, model.source());
    }
}
