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

package com.azure.resourcemanager.dashboard.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.dashboard.models.AzureMonitorWorkspaceIntegration;
import com.azure.resourcemanager.dashboard.models.GrafanaIntegrations;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;

public final class GrafanaIntegrationsTests {
    @Test
    public void testDeserialize() {
        GrafanaIntegrations model =
            BinaryData
                .fromString(
                    "{\"azureMonitorWorkspaceIntegrations\":[{\"azureMonitorWorkspaceResourceId\":\"pymzidnsezcxtbzs\"}]}")
                .toObject(GrafanaIntegrations.class);
        Assertions
            .assertEquals(
                "pymzidnsezcxtbzs", model.azureMonitorWorkspaceIntegrations().get(0).azureMonitorWorkspaceResourceId());
    }

    @Test
    public void testSerialize() {
        GrafanaIntegrations model =
            new GrafanaIntegrations()
                .withAzureMonitorWorkspaceIntegrations(
                    Arrays
                        .asList(
                            new AzureMonitorWorkspaceIntegration()
                                .withAzureMonitorWorkspaceResourceId("pymzidnsezcxtbzs")));
        model = BinaryData.fromObject(model).toObject(GrafanaIntegrations.class);
        Assertions
            .assertEquals(
                "pymzidnsezcxtbzs", model.azureMonitorWorkspaceIntegrations().get(0).azureMonitorWorkspaceResourceId());
    }
}
