// 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.fluent.models.ManagementConfigurationPropertiesListInner;
import com.azure.resourcemanager.operationsmanagement.models.ManagementConfigurationProperties;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;

public final class ManagementConfigurationPropertiesListInnerTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        ManagementConfigurationPropertiesListInner model =
            BinaryData
                .fromString(
                    "{\"value\":[{\"location\":\"yejhk\",\"properties\":{\"applicationId\":\"tnapczwlokjyemkk\",\"parentResourceType\":\"ni\",\"parameters\":[],\"provisioningState\":\"oxzjnchgejspod\",\"template\":\"dataailzydehojwyahu\"},\"id\":\"inpm\",\"name\":\"njaqwixjspro\",\"type\":\"vcputegj\"},{\"location\":\"mfdatscmdvpj\",\"properties\":{\"applicationId\":\"suuv\",\"parentResourceType\":\"kjozkrwfnd\",\"parameters\":[],\"provisioningState\":\"djpslw\",\"template\":\"datajdpvwryo\"},\"id\":\"psoacctazakljl\",\"name\":\"hbcryffdfdosyge\",\"type\":\"paojakhmsbzjh\"},{\"location\":\"zevdphlx\",\"properties\":{\"applicationId\":\"thqt\",\"parentResourceType\":\"gqjbpfzfsin\",\"parameters\":[],\"provisioningState\":\"v\",\"template\":\"datacjrwzoxxjtfellu\"},\"id\":\"fziton\",\"name\":\"eqfpj\",\"type\":\"jlxofpdvhpfxxyp\"},{\"location\":\"i\",\"properties\":{\"applicationId\":\"yhuybbkpod\",\"parentResourceType\":\"po\",\"parameters\":[],\"provisioningState\":\"inuvamiheogn\",\"template\":\"datarxzxtheo\"},\"id\":\"usivye\",\"name\":\"cciqihnhungbwjz\",\"type\":\"nfygxgispemvtz\"}]}")
                .toObject(ManagementConfigurationPropertiesListInner.class);
        Assertions.assertEquals("yejhk", model.value().get(0).location());
        Assertions.assertEquals("tnapczwlokjyemkk", model.value().get(0).properties().applicationId());
        Assertions.assertEquals("ni", model.value().get(0).properties().parentResourceType());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        ManagementConfigurationPropertiesListInner model =
            new ManagementConfigurationPropertiesListInner()
                .withValue(
                    Arrays
                        .asList(
                            new ManagementConfigurationInner()
                                .withLocation("yejhk")
                                .withProperties(
                                    new ManagementConfigurationProperties()
                                        .withApplicationId("tnapczwlokjyemkk")
                                        .withParentResourceType("ni")
                                        .withParameters(Arrays.asList())
                                        .withTemplate("dataailzydehojwyahu")),
                            new ManagementConfigurationInner()
                                .withLocation("mfdatscmdvpj")
                                .withProperties(
                                    new ManagementConfigurationProperties()
                                        .withApplicationId("suuv")
                                        .withParentResourceType("kjozkrwfnd")
                                        .withParameters(Arrays.asList())
                                        .withTemplate("datajdpvwryo")),
                            new ManagementConfigurationInner()
                                .withLocation("zevdphlx")
                                .withProperties(
                                    new ManagementConfigurationProperties()
                                        .withApplicationId("thqt")
                                        .withParentResourceType("gqjbpfzfsin")
                                        .withParameters(Arrays.asList())
                                        .withTemplate("datacjrwzoxxjtfellu")),
                            new ManagementConfigurationInner()
                                .withLocation("i")
                                .withProperties(
                                    new ManagementConfigurationProperties()
                                        .withApplicationId("yhuybbkpod")
                                        .withParentResourceType("po")
                                        .withParameters(Arrays.asList())
                                        .withTemplate("datarxzxtheo"))));
        model = BinaryData.fromObject(model).toObject(ManagementConfigurationPropertiesListInner.class);
        Assertions.assertEquals("yejhk", model.value().get(0).location());
        Assertions.assertEquals("tnapczwlokjyemkk", model.value().get(0).properties().applicationId());
        Assertions.assertEquals("ni", model.value().get(0).properties().parentResourceType());
    }
}
