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

package com.azure.resourcemanager.powerbidedicated.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.powerbidedicated.fluent.models.OperationInner;
import com.azure.resourcemanager.powerbidedicated.models.OperationDisplay;
import com.azure.resourcemanager.powerbidedicated.models.OperationProperties;
import com.azure.resourcemanager.powerbidedicated.models.ServiceSpecification;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;

public final class OperationInnerTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        OperationInner model =
            BinaryData
                .fromString(
                    "{\"name\":\"eiachboosflnr\",\"display\":{\"provider\":\"qpteeh\",\"resource\":\"vypyqrimzinpv\",\"operation\":\"jdkirsoodqx\",\"description\":\"rmnohj\"},\"origin\":\"kwh\",\"properties\":{\"serviceSpecification\":{\"metricSpecifications\":[],\"logSpecifications\":[]}}}")
                .toObject(OperationInner.class);
        Assertions.assertEquals("rmnohj", model.display().description());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        OperationInner model =
            new OperationInner()
                .withDisplay(new OperationDisplay().withDescription("rmnohj"))
                .withProperties(
                    new OperationProperties()
                        .withServiceSpecification(
                            new ServiceSpecification()
                                .withMetricSpecifications(Arrays.asList())
                                .withLogSpecifications(Arrays.asList())));
        model = BinaryData.fromObject(model).toObject(OperationInner.class);
        Assertions.assertEquals("rmnohj", model.display().description());
    }
}
