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

package com.azure.resourcemanager.synapse.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.synapse.fluent.models.PrivateEndpointConnectionForPrivateLinkHubInner;
import com.azure.resourcemanager.synapse.fluent.models.PrivateEndpointConnectionProperties;
import com.azure.resourcemanager.synapse.models.PrivateEndpointConnectionForPrivateLinkHubResourceCollectionResponse;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;

public final class PrivateEndpointConnectionForPrivateLinkHubResourceCollectionResponseTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        PrivateEndpointConnectionForPrivateLinkHubResourceCollectionResponse model =
            BinaryData
                .fromString(
                    "{\"value\":[{\"name\":\"yvshxmz\",\"type\":\"bzoggigrx\",\"id\":\"ur\",\"properties\":{\"provisioningState\":\"nspydptkoenkoukn\"}}],\"nextLink\":\"dwtiukbldngkp\"}")
                .toObject(PrivateEndpointConnectionForPrivateLinkHubResourceCollectionResponse.class);
        Assertions.assertEquals("ur", model.value().get(0).id());
        Assertions.assertEquals("yvshxmz", model.value().get(0).name());
        Assertions.assertEquals("bzoggigrx", model.value().get(0).type());
        Assertions.assertEquals("dwtiukbldngkp", model.nextLink());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        PrivateEndpointConnectionForPrivateLinkHubResourceCollectionResponse model =
            new PrivateEndpointConnectionForPrivateLinkHubResourceCollectionResponse()
                .withValue(
                    Arrays
                        .asList(
                            new PrivateEndpointConnectionForPrivateLinkHubInner()
                                .withId("ur")
                                .withProperties(new PrivateEndpointConnectionProperties())
                                .withName("yvshxmz")
                                .withType("bzoggigrx")))
                .withNextLink("dwtiukbldngkp");
        model =
            BinaryData
                .fromObject(model)
                .toObject(PrivateEndpointConnectionForPrivateLinkHubResourceCollectionResponse.class);
        Assertions.assertEquals("ur", model.value().get(0).id());
        Assertions.assertEquals("yvshxmz", model.value().get(0).name());
        Assertions.assertEquals("bzoggigrx", model.value().get(0).type());
        Assertions.assertEquals("dwtiukbldngkp", model.nextLink());
    }
}
