// 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.ConfigurationInner;
import com.azure.resourcemanager.mysqlflexibleserver.models.ConfigurationSource;
import org.junit.jupiter.api.Assertions;

public final class ConfigurationInnerTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        ConfigurationInner model =
            BinaryData
                .fromString(
                    "{\"properties\":{\"value\":\"qtrgqjbpfzfsinzg\",\"currentValue\":\"cjrwzoxxjtfellu\",\"description\":\"zitonpeqfpjkjl\",\"documentationLink\":\"fpdvhpfxxypi\",\"defaultValue\":\"nmayhuybb\",\"dataType\":\"odepoogin\",\"allowedValues\":\"amiheognarxz\",\"source\":\"system-default\",\"isReadOnly\":\"True\",\"isConfigPendingRestart\":\"True\",\"isDynamicConfig\":\"False\"},\"id\":\"yevc\",\"name\":\"iqihn\",\"type\":\"un\"}")
                .toObject(ConfigurationInner.class);
        Assertions.assertEquals("qtrgqjbpfzfsinzg", model.value());
        Assertions.assertEquals("cjrwzoxxjtfellu", model.currentValue());
        Assertions.assertEquals(ConfigurationSource.SYSTEM_DEFAULT, model.source());
    }

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