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

package com.azure.resourcemanager.hybridcompute.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.hybridcompute.models.PrivateEndpointConnectionProperties;
import com.azure.resourcemanager.hybridcompute.models.PrivateEndpointProperty;
import com.azure.resourcemanager.hybridcompute.models.PrivateLinkServiceConnectionStateProperty;
import org.junit.jupiter.api.Assertions;

public final class PrivateEndpointConnectionPropertiesTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        PrivateEndpointConnectionProperties model =
            BinaryData
                .fromString(
                    "{\"privateEndpoint\":{\"id\":\"avwhheunm\"},\"privateLinkServiceConnectionState\":{\"status\":\"hgyxzkonoc\",\"description\":\"koklya\",\"actionsRequired\":\"conuqszfkbeype\"},\"provisioningState\":\"mjmwvvjektcx\"}")
                .toObject(PrivateEndpointConnectionProperties.class);
        Assertions.assertEquals("avwhheunm", model.privateEndpoint().id());
        Assertions.assertEquals("hgyxzkonoc", model.privateLinkServiceConnectionState().status());
        Assertions.assertEquals("koklya", model.privateLinkServiceConnectionState().description());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        PrivateEndpointConnectionProperties model =
            new PrivateEndpointConnectionProperties()
                .withPrivateEndpoint(new PrivateEndpointProperty().withId("avwhheunm"))
                .withPrivateLinkServiceConnectionState(
                    new PrivateLinkServiceConnectionStateProperty().withStatus("hgyxzkonoc").withDescription("koklya"));
        model = BinaryData.fromObject(model).toObject(PrivateEndpointConnectionProperties.class);
        Assertions.assertEquals("avwhheunm", model.privateEndpoint().id());
        Assertions.assertEquals("hgyxzkonoc", model.privateLinkServiceConnectionState().status());
        Assertions.assertEquals("koklya", model.privateLinkServiceConnectionState().description());
    }
}
