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

package com.azure.resourcemanager.apimanagement.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.apimanagement.fluent.models.OperationInner;
import com.azure.resourcemanager.apimanagement.models.OperationDisplay;
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\":\"w\",\"display\":{\"provider\":\"aexqokmyrlj\",\"operation\":\"lzbnobrqlpbcjt\",\"resource\":\"zuyudivbxnh\",\"description\":\"eaeonqelwgdh\"},\"origin\":\"uzytz\",\"properties\":\"dataogatmoljiy\"}")
                .toObject(OperationInner.class);
        Assertions.assertEquals("w", model.name());
        Assertions.assertEquals("aexqokmyrlj", model.display().provider());
        Assertions.assertEquals("lzbnobrqlpbcjt", model.display().operation());
        Assertions.assertEquals("zuyudivbxnh", model.display().resource());
        Assertions.assertEquals("eaeonqelwgdh", model.display().description());
        Assertions.assertEquals("uzytz", model.origin());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        OperationInner model =
            new OperationInner()
                .withName("w")
                .withDisplay(
                    new OperationDisplay()
                        .withProvider("aexqokmyrlj")
                        .withOperation("lzbnobrqlpbcjt")
                        .withResource("zuyudivbxnh")
                        .withDescription("eaeonqelwgdh"))
                .withOrigin("uzytz")
                .withProperties("dataogatmoljiy");
        model = BinaryData.fromObject(model).toObject(OperationInner.class);
        Assertions.assertEquals("w", model.name());
        Assertions.assertEquals("aexqokmyrlj", model.display().provider());
        Assertions.assertEquals("lzbnobrqlpbcjt", model.display().operation());
        Assertions.assertEquals("zuyudivbxnh", model.display().resource());
        Assertions.assertEquals("eaeonqelwgdh", model.display().description());
        Assertions.assertEquals("uzytz", model.origin());
    }
}
