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

package com.azure.resourcemanager.elastic.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.elastic.fluent.models.MonitoringTagRulesInner;
import com.azure.resourcemanager.elastic.models.MonitoringTagRulesListResponse;
import com.azure.resourcemanager.elastic.models.MonitoringTagRulesProperties;
import com.azure.resourcemanager.elastic.models.ProvisioningState;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;

public final class MonitoringTagRulesListResponseTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        MonitoringTagRulesListResponse model =
            BinaryData
                .fromString(
                    "{\"value\":[{\"properties\":{\"provisioningState\":\"NotSpecified\"},\"id\":\"chboosflnrosf\",\"name\":\"pteehzzv\",\"type\":\"pyqr\"},{\"properties\":{\"provisioningState\":\"Updating\"},\"id\":\"vswjdk\",\"name\":\"rsoodqxhcrmnoh\",\"type\":\"t\"}],\"nextLink\":\"whdsoifiyip\"}")
                .toObject(MonitoringTagRulesListResponse.class);
        Assertions.assertEquals(ProvisioningState.NOT_SPECIFIED, model.value().get(0).properties().provisioningState());
        Assertions.assertEquals("whdsoifiyip", model.nextLink());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        MonitoringTagRulesListResponse model =
            new MonitoringTagRulesListResponse()
                .withValue(
                    Arrays
                        .asList(
                            new MonitoringTagRulesInner()
                                .withProperties(
                                    new MonitoringTagRulesProperties()
                                        .withProvisioningState(ProvisioningState.NOT_SPECIFIED)),
                            new MonitoringTagRulesInner()
                                .withProperties(
                                    new MonitoringTagRulesProperties()
                                        .withProvisioningState(ProvisioningState.UPDATING))))
                .withNextLink("whdsoifiyip");
        model = BinaryData.fromObject(model).toObject(MonitoringTagRulesListResponse.class);
        Assertions.assertEquals(ProvisioningState.NOT_SPECIFIED, model.value().get(0).properties().provisioningState());
        Assertions.assertEquals("whdsoifiyip", model.nextLink());
    }
}
