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

package com.azure.resourcemanager.operationsmanagement.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.operationsmanagement.fluent.models.ManagementConfigurationInner;
import com.azure.resourcemanager.operationsmanagement.models.ArmTemplateParameter;
import com.azure.resourcemanager.operationsmanagement.models.ManagementConfigurationProperties;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;

public final class ManagementConfigurationInnerTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        ManagementConfigurationInner model =
            BinaryData
                .fromString(
                    "{\"location\":\"ufubl\",\"properties\":{\"applicationId\":\"xqeofjaeqjhqjba\",\"parentResourceType\":\"v\",\"parameters\":[{\"name\":\"jqul\",\"value\":\"sntnbybkzgcw\"},{\"name\":\"clxxwrljdo\",\"value\":\"kcqvkocrc\"},{\"name\":\"kwt\",\"value\":\"xbnjbiksq\"},{\"name\":\"lssai\",\"value\":\"p\"}],\"provisioningState\":\"nzl\",\"template\":\"datajfm\"},\"id\":\"pee\",\"name\":\"vmgxsab\",\"type\":\"yqduujit\"}")
                .toObject(ManagementConfigurationInner.class);
        Assertions.assertEquals("ufubl", model.location());
        Assertions.assertEquals("xqeofjaeqjhqjba", model.properties().applicationId());
        Assertions.assertEquals("v", model.properties().parentResourceType());
        Assertions.assertEquals("jqul", model.properties().parameters().get(0).name());
        Assertions.assertEquals("sntnbybkzgcw", model.properties().parameters().get(0).value());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        ManagementConfigurationInner model =
            new ManagementConfigurationInner()
                .withLocation("ufubl")
                .withProperties(
                    new ManagementConfigurationProperties()
                        .withApplicationId("xqeofjaeqjhqjba")
                        .withParentResourceType("v")
                        .withParameters(
                            Arrays
                                .asList(
                                    new ArmTemplateParameter().withName("jqul").withValue("sntnbybkzgcw"),
                                    new ArmTemplateParameter().withName("clxxwrljdo").withValue("kcqvkocrc"),
                                    new ArmTemplateParameter().withName("kwt").withValue("xbnjbiksq"),
                                    new ArmTemplateParameter().withName("lssai").withValue("p")))
                        .withTemplate("datajfm"));
        model = BinaryData.fromObject(model).toObject(ManagementConfigurationInner.class);
        Assertions.assertEquals("ufubl", model.location());
        Assertions.assertEquals("xqeofjaeqjhqjba", model.properties().applicationId());
        Assertions.assertEquals("v", model.properties().parentResourceType());
        Assertions.assertEquals("jqul", model.properties().parameters().get(0).name());
        Assertions.assertEquals("sntnbybkzgcw", model.properties().parameters().get(0).value());
    }
}
