// 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;

public final class ApplicationGetEndpointTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        ApplicationGetEndpoint model =
            BinaryData
                .fromString(
                    "{\"location\":\"iith\",\"destinationPort\":63986979,\"publicPort\":511745945,\"privateIPAddress\":\"v\"}")
                .toObject(ApplicationGetEndpoint.class);
        Assertions.assertEquals("iith", model.location());
        Assertions.assertEquals(63986979, model.destinationPort());
        Assertions.assertEquals(511745945, model.publicPort());
        Assertions.assertEquals("v", model.privateIpAddress());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        ApplicationGetEndpoint model =
            new ApplicationGetEndpoint()
                .withLocation("iith")
                .withDestinationPort(63986979)
                .withPublicPort(511745945)
                .withPrivateIpAddress("v");
        model = BinaryData.fromObject(model).toObject(ApplicationGetEndpoint.class);
        Assertions.assertEquals("iith", model.location());
        Assertions.assertEquals(63986979, model.destinationPort());
        Assertions.assertEquals(511745945, model.publicPort());
        Assertions.assertEquals("v", model.privateIpAddress());
    }
}
