// 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.fluent.models.PrivateEndpointConnectionInner;
import com.azure.resourcemanager.hdinsight.models.PrivateLinkServiceConnectionState;
import com.azure.resourcemanager.hdinsight.models.PrivateLinkServiceConnectionStatus;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;

public final class PrivateEndpointConnectionInnerTests {
    @Test
    public void testDeserialize() {
        PrivateEndpointConnectionInner model =
            BinaryData
                .fromString(
                    "{\"properties\":{\"privateEndpoint\":{\"id\":\"y\"},\"privateLinkServiceConnectionState\":{\"status\":\"Removed\",\"description\":\"v\",\"actionsRequired\":\"csonpclhoco\"},\"linkIdentifier\":\"lkevle\",\"provisioningState\":\"Failed\"},\"id\":\"buhfmvfaxkffeiit\",\"name\":\"lvmezyvshxmzsbbz\",\"type\":\"ggi\"}")
                .toObject(PrivateEndpointConnectionInner.class);
        Assertions
            .assertEquals(
                PrivateLinkServiceConnectionStatus.REMOVED, model.privateLinkServiceConnectionState().status());
        Assertions.assertEquals("v", model.privateLinkServiceConnectionState().description());
        Assertions.assertEquals("csonpclhoco", model.privateLinkServiceConnectionState().actionsRequired());
    }

    @Test
    public void testSerialize() {
        PrivateEndpointConnectionInner model =
            new PrivateEndpointConnectionInner()
                .withPrivateLinkServiceConnectionState(
                    new PrivateLinkServiceConnectionState()
                        .withStatus(PrivateLinkServiceConnectionStatus.REMOVED)
                        .withDescription("v")
                        .withActionsRequired("csonpclhoco"));
        model = BinaryData.fromObject(model).toObject(PrivateEndpointConnectionInner.class);
        Assertions
            .assertEquals(
                PrivateLinkServiceConnectionStatus.REMOVED, model.privateLinkServiceConnectionState().status());
        Assertions.assertEquals("v", model.privateLinkServiceConnectionState().description());
        Assertions.assertEquals("csonpclhoco", model.privateLinkServiceConnectionState().actionsRequired());
    }
}
