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

public final class ApplicationGetEndpointTests {
    @Test
    public void testDeserialize() {
        ApplicationGetEndpoint model =
            BinaryData
                .fromString(
                    "{\"location\":\"vhelxprglyatdd\",\"destinationPort\":1454263457,\"publicPort\":373907539,\"privateIPAddress\":\"ejrjxgciqibrho\"}")
                .toObject(ApplicationGetEndpoint.class);
        Assertions.assertEquals("vhelxprglyatdd", model.location());
        Assertions.assertEquals(1454263457, model.destinationPort());
        Assertions.assertEquals(373907539, model.publicPort());
        Assertions.assertEquals("ejrjxgciqibrho", model.privateIpAddress());
    }

    @Test
    public void testSerialize() {
        ApplicationGetEndpoint model =
            new ApplicationGetEndpoint()
                .withLocation("vhelxprglyatdd")
                .withDestinationPort(1454263457)
                .withPublicPort(373907539)
                .withPrivateIpAddress("ejrjxgciqibrho");
        model = BinaryData.fromObject(model).toObject(ApplicationGetEndpoint.class);
        Assertions.assertEquals("vhelxprglyatdd", model.location());
        Assertions.assertEquals(1454263457, model.destinationPort());
        Assertions.assertEquals(373907539, model.publicPort());
        Assertions.assertEquals("ejrjxgciqibrho", model.privateIpAddress());
    }
}
