// 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.AvailableRpOperationInner;
import com.azure.resourcemanager.synapse.models.AvailableRpOperationDisplayInfo;
import com.azure.resourcemanager.synapse.models.OperationMetaServiceSpecification;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;

public final class AvailableRpOperationInnerTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        AvailableRpOperationInner model =
            BinaryData
                .fromString(
                    "{\"display\":{\"description\":\"z\",\"resource\":\"chgejspodm\",\"provider\":\"lzydehojwyahux\",\"operation\":\"pmqnja\"},\"isDataAction\":\"ixjsprozvcputeg\",\"name\":\"wmfdatscmdvpjhul\",\"properties\":{\"serviceSpecification\":{\"metricSpecifications\":[],\"logSpecifications\":[]}},\"origin\":\"zkrwfn\"}")
                .toObject(AvailableRpOperationInner.class);
        Assertions.assertEquals("z", model.display().description());
        Assertions.assertEquals("chgejspodm", model.display().resource());
        Assertions.assertEquals("lzydehojwyahux", model.display().provider());
        Assertions.assertEquals("pmqnja", model.display().operation());
        Assertions.assertEquals("ixjsprozvcputeg", model.isDataAction());
        Assertions.assertEquals("wmfdatscmdvpjhul", model.name());
        Assertions.assertEquals("zkrwfn", model.origin());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        AvailableRpOperationInner model =
            new AvailableRpOperationInner()
                .withDisplay(
                    new AvailableRpOperationDisplayInfo()
                        .withDescription("z")
                        .withResource("chgejspodm")
                        .withProvider("lzydehojwyahux")
                        .withOperation("pmqnja"))
                .withIsDataAction("ixjsprozvcputeg")
                .withName("wmfdatscmdvpjhul")
                .withOrigin("zkrwfn")
                .withServiceSpecification(
                    new OperationMetaServiceSpecification()
                        .withMetricSpecifications(Arrays.asList())
                        .withLogSpecifications(Arrays.asList()));
        model = BinaryData.fromObject(model).toObject(AvailableRpOperationInner.class);
        Assertions.assertEquals("z", model.display().description());
        Assertions.assertEquals("chgejspodm", model.display().resource());
        Assertions.assertEquals("lzydehojwyahux", model.display().provider());
        Assertions.assertEquals("pmqnja", model.display().operation());
        Assertions.assertEquals("ixjsprozvcputeg", model.isDataAction());
        Assertions.assertEquals("wmfdatscmdvpjhul", model.name());
        Assertions.assertEquals("zkrwfn", model.origin());
    }
}
