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

package com.azure.resourcemanager.resourcehealth.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.resourcehealth.fluent.models.MetadataEntityInner;
import com.azure.resourcemanager.resourcehealth.models.MetadataEntityListResult;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;

public final class MetadataEntityListResultTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        MetadataEntityListResult model =
            BinaryData
                .fromString(
                    "{\"value\":[{\"properties\":{\"displayName\":\"rlovmclwhijcoej\",\"dependsOn\":[],\"applicableScenarios\":[],\"supportedValues\":[]},\"id\":\"qsqsy\",\"name\":\"bkbfkgukdkex\",\"type\":\"ppofmxaxcfjpgdd\"},{\"properties\":{\"displayName\":\"jjxhvpmo\",\"dependsOn\":[],\"applicableScenarios\":[],\"supportedValues\":[]},\"id\":\"zxibqeoj\",\"name\":\"xqbzvddntwnd\",\"type\":\"icbtwnpzao\"}],\"nextLink\":\"uhrhcffcyddgl\"}")
                .toObject(MetadataEntityListResult.class);
        Assertions.assertEquals("rlovmclwhijcoej", model.value().get(0).displayName());
        Assertions.assertEquals("uhrhcffcyddgl", model.nextLink());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        MetadataEntityListResult model =
            new MetadataEntityListResult()
                .withValue(
                    Arrays
                        .asList(
                            new MetadataEntityInner()
                                .withDisplayName("rlovmclwhijcoej")
                                .withDependsOn(Arrays.asList())
                                .withApplicableScenarios(Arrays.asList())
                                .withSupportedValues(Arrays.asList()),
                            new MetadataEntityInner()
                                .withDisplayName("jjxhvpmo")
                                .withDependsOn(Arrays.asList())
                                .withApplicableScenarios(Arrays.asList())
                                .withSupportedValues(Arrays.asList())))
                .withNextLink("uhrhcffcyddgl");
        model = BinaryData.fromObject(model).toObject(MetadataEntityListResult.class);
        Assertions.assertEquals("rlovmclwhijcoej", model.value().get(0).displayName());
        Assertions.assertEquals("uhrhcffcyddgl", model.nextLink());
    }
}
