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

package com.azure.resourcemanager.hdinsight.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.hdinsight.models.ConnectivityEndpoint;
import org.junit.jupiter.api.Assertions;

public final class ConnectivityEndpointTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        ConnectivityEndpoint model =
            BinaryData
                .fromString(
                    "{\"name\":\"vasrruvwb\",\"protocol\":\"qfsubcgjbirx\",\"location\":\"ybsrfbjfdtwss\",\"port\":772106102,\"privateIPAddress\":\"pvjzbe\"}")
                .toObject(ConnectivityEndpoint.class);
        Assertions.assertEquals("vasrruvwb", model.name());
        Assertions.assertEquals("qfsubcgjbirx", model.protocol());
        Assertions.assertEquals("ybsrfbjfdtwss", model.location());
        Assertions.assertEquals(772106102, model.port());
        Assertions.assertEquals("pvjzbe", model.privateIpAddress());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        ConnectivityEndpoint model =
            new ConnectivityEndpoint()
                .withName("vasrruvwb")
                .withProtocol("qfsubcgjbirx")
                .withLocation("ybsrfbjfdtwss")
                .withPort(772106102)
                .withPrivateIpAddress("pvjzbe");
        model = BinaryData.fromObject(model).toObject(ConnectivityEndpoint.class);
        Assertions.assertEquals("vasrruvwb", model.name());
        Assertions.assertEquals("qfsubcgjbirx", model.protocol());
        Assertions.assertEquals("ybsrfbjfdtwss", model.location());
        Assertions.assertEquals(772106102, model.port());
        Assertions.assertEquals("pvjzbe", model.privateIpAddress());
    }
}
