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

package com.azure.resourcemanager.logic.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.logic.models.IntegrationServiceEnvironmentNetworkEndPointAccessibilityState;
import com.azure.resourcemanager.logic.models.IntegrationServiceEnvironmentNetworkEndpoint;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;

public final class IntegrationServiceEnvironmentNetworkEndpointTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        IntegrationServiceEnvironmentNetworkEndpoint model =
            BinaryData
                .fromString(
                    "{\"accessibility\":\"NotAvailable\",\"domainName\":\"z\",\"ports\":[\"izehtdhgbjk\",\"reljeamur\",\"zmlovuanash\"]}")
                .toObject(IntegrationServiceEnvironmentNetworkEndpoint.class);
        Assertions
            .assertEquals(
                IntegrationServiceEnvironmentNetworkEndPointAccessibilityState.NOT_AVAILABLE, model.accessibility());
        Assertions.assertEquals("z", model.domainName());
        Assertions.assertEquals("izehtdhgbjk", model.ports().get(0));
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        IntegrationServiceEnvironmentNetworkEndpoint model =
            new IntegrationServiceEnvironmentNetworkEndpoint()
                .withAccessibility(IntegrationServiceEnvironmentNetworkEndPointAccessibilityState.NOT_AVAILABLE)
                .withDomainName("z")
                .withPorts(Arrays.asList("izehtdhgbjk", "reljeamur", "zmlovuanash"));
        model = BinaryData.fromObject(model).toObject(IntegrationServiceEnvironmentNetworkEndpoint.class);
        Assertions
            .assertEquals(
                IntegrationServiceEnvironmentNetworkEndPointAccessibilityState.NOT_AVAILABLE, model.accessibility());
        Assertions.assertEquals("z", model.domainName());
        Assertions.assertEquals("izehtdhgbjk", model.ports().get(0));
    }
}
