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

package com.azure.resourcemanager.machinelearning.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.machinelearning.fluent.models.SharedPrivateLinkResourceProperty;
import com.azure.resourcemanager.machinelearning.models.PrivateEndpointServiceConnectionStatus;
import org.junit.jupiter.api.Assertions;

public final class SharedPrivateLinkResourcePropertyTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        SharedPrivateLinkResourceProperty model =
            BinaryData
                .fromString(
                    "{\"privateLinkResourceId\":\"s\",\"groupId\":\"smjqulngsntnbyb\",\"requestMessage\":\"gc\",\"status\":\"Approved\"}")
                .toObject(SharedPrivateLinkResourceProperty.class);
        Assertions.assertEquals("s", model.privateLinkResourceId());
        Assertions.assertEquals("smjqulngsntnbyb", model.groupId());
        Assertions.assertEquals("gc", model.requestMessage());
        Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.APPROVED, model.status());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        SharedPrivateLinkResourceProperty model =
            new SharedPrivateLinkResourceProperty()
                .withPrivateLinkResourceId("s")
                .withGroupId("smjqulngsntnbyb")
                .withRequestMessage("gc")
                .withStatus(PrivateEndpointServiceConnectionStatus.APPROVED);
        model = BinaryData.fromObject(model).toObject(SharedPrivateLinkResourceProperty.class);
        Assertions.assertEquals("s", model.privateLinkResourceId());
        Assertions.assertEquals("smjqulngsntnbyb", model.groupId());
        Assertions.assertEquals("gc", model.requestMessage());
        Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.APPROVED, model.status());
    }
}
