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

package com.azure.resourcemanager.machinelearning.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.machinelearning.fluent.models.ExternalFqdnResponseInner;
import com.azure.resourcemanager.machinelearning.models.FqdnEndpoints;
import com.azure.resourcemanager.machinelearning.models.FqdnEndpointsProperties;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;

public final class ExternalFqdnResponseInnerTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        ExternalFqdnResponseInner model =
            BinaryData
                .fromString(
                    "{\"value\":[{\"properties\":{\"category\":\"jflcxog\",\"endpoints\":[]}},{\"properties\":{\"category\":\"nzmnsikvm\",\"endpoints\":[]}}]}")
                .toObject(ExternalFqdnResponseInner.class);
        Assertions.assertEquals("jflcxog", model.value().get(0).properties().category());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        ExternalFqdnResponseInner model =
            new ExternalFqdnResponseInner()
                .withValue(
                    Arrays
                        .asList(
                            new FqdnEndpoints()
                                .withProperties(
                                    new FqdnEndpointsProperties()
                                        .withCategory("jflcxog")
                                        .withEndpoints(Arrays.asList())),
                            new FqdnEndpoints()
                                .withProperties(
                                    new FqdnEndpointsProperties()
                                        .withCategory("nzmnsikvm")
                                        .withEndpoints(Arrays.asList()))));
        model = BinaryData.fromObject(model).toObject(ExternalFqdnResponseInner.class);
        Assertions.assertEquals("jflcxog", model.value().get(0).properties().category());
    }
}
