// 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;
import org.junit.jupiter.api.Test;

public final class ConnectivityEndpointTests {
    @Test
    public void testDeserialize() {
        ConnectivityEndpoint model =
            BinaryData
                .fromString(
                    "{\"name\":\"vsovmyokac\",\"protocol\":\"kwlhzdo\",\"location\":\"xjmflbvv\",\"port\":681133133,\"privateIPAddress\":\"kcciwwzjuqkhr\"}")
                .toObject(ConnectivityEndpoint.class);
        Assertions.assertEquals("vsovmyokac", model.name());
        Assertions.assertEquals("kwlhzdo", model.protocol());
        Assertions.assertEquals("xjmflbvv", model.location());
        Assertions.assertEquals(681133133, model.port());
        Assertions.assertEquals("kcciwwzjuqkhr", model.privateIpAddress());
    }

    @Test
    public void testSerialize() {
        ConnectivityEndpoint model =
            new ConnectivityEndpoint()
                .withName("vsovmyokac")
                .withProtocol("kwlhzdo")
                .withLocation("xjmflbvv")
                .withPort(681133133)
                .withPrivateIpAddress("kcciwwzjuqkhr");
        model = BinaryData.fromObject(model).toObject(ConnectivityEndpoint.class);
        Assertions.assertEquals("vsovmyokac", model.name());
        Assertions.assertEquals("kwlhzdo", model.protocol());
        Assertions.assertEquals("xjmflbvv", model.location());
        Assertions.assertEquals(681133133, model.port());
        Assertions.assertEquals("kcciwwzjuqkhr", model.privateIpAddress());
    }
}
