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

package com.azure.resourcemanager.storagepool.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.storagepool.fluent.models.OutboundEnvironmentEndpointInner;
import com.azure.resourcemanager.storagepool.models.OutboundEnvironmentEndpointList;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;

public final class OutboundEnvironmentEndpointListTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        OutboundEnvironmentEndpointList model =
            BinaryData
                .fromString(
                    "{\"value\":[{\"category\":\"icohoqqnwvl\",\"endpoints\":[]},{\"category\":\"w\",\"endpoints\":[]},{\"category\":\"nmmqhgyxzkon\",\"endpoints\":[]}],\"nextLink\":\"oklyaxuconuq\"}")
                .toObject(OutboundEnvironmentEndpointList.class);
        Assertions.assertEquals("icohoqqnwvl", model.value().get(0).category());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        OutboundEnvironmentEndpointList model =
            new OutboundEnvironmentEndpointList()
                .withValue(
                    Arrays
                        .asList(
                            new OutboundEnvironmentEndpointInner()
                                .withCategory("icohoqqnwvl")
                                .withEndpoints(Arrays.asList()),
                            new OutboundEnvironmentEndpointInner().withCategory("w").withEndpoints(Arrays.asList()),
                            new OutboundEnvironmentEndpointInner()
                                .withCategory("nmmqhgyxzkon")
                                .withEndpoints(Arrays.asList())));
        model = BinaryData.fromObject(model).toObject(OutboundEnvironmentEndpointList.class);
        Assertions.assertEquals("icohoqqnwvl", model.value().get(0).category());
    }
}
