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

package com.azure.resourcemanager.digitaltwins.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.digitaltwins.models.ConnectionPropertiesPrivateLinkServiceConnectionState;
import com.azure.resourcemanager.digitaltwins.models.PrivateLinkServiceConnectionStatus;
import org.junit.jupiter.api.Assertions;

public final class ConnectionPropertiesPrivateLinkServiceConnectionStateTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        ConnectionPropertiesPrivateLinkServiceConnectionState model =
            BinaryData
                .fromString("{\"status\":\"Rejected\",\"description\":\"slwejdpvw\",\"actionsRequired\":\"oqpsoa\"}")
                .toObject(ConnectionPropertiesPrivateLinkServiceConnectionState.class);
        Assertions.assertEquals(PrivateLinkServiceConnectionStatus.REJECTED, model.status());
        Assertions.assertEquals("slwejdpvw", model.description());
        Assertions.assertEquals("oqpsoa", model.actionsRequired());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        ConnectionPropertiesPrivateLinkServiceConnectionState model =
            new ConnectionPropertiesPrivateLinkServiceConnectionState()
                .withStatus(PrivateLinkServiceConnectionStatus.REJECTED)
                .withDescription("slwejdpvw")
                .withActionsRequired("oqpsoa");
        model = BinaryData.fromObject(model).toObject(ConnectionPropertiesPrivateLinkServiceConnectionState.class);
        Assertions.assertEquals(PrivateLinkServiceConnectionStatus.REJECTED, model.status());
        Assertions.assertEquals("slwejdpvw", model.description());
        Assertions.assertEquals("oqpsoa", model.actionsRequired());
    }
}
