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

package com.azure.resourcemanager.kubernetesconfiguration.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.kubernetesconfiguration.fluent.models.ResourceProviderOperationInner;
import com.azure.resourcemanager.kubernetesconfiguration.models.ResourceProviderOperationDisplay;
import org.junit.jupiter.api.Assertions;

public final class ResourceProviderOperationInnerTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        ResourceProviderOperationInner model =
            BinaryData
                .fromString(
                    "{\"name\":\"idybyxczf\",\"display\":{\"provider\":\"aaxdbabphlwrq\",\"resource\":\"ktsthsucocmny\",\"operation\":\"zt\",\"description\":\"twwrqp\"},\"isDataAction\":true,\"origin\":\"kzywbiex\"}")
                .toObject(ResourceProviderOperationInner.class);
        Assertions.assertEquals("idybyxczf", model.name());
        Assertions.assertEquals("aaxdbabphlwrq", model.display().provider());
        Assertions.assertEquals("ktsthsucocmny", model.display().resource());
        Assertions.assertEquals("zt", model.display().operation());
        Assertions.assertEquals("twwrqp", model.display().description());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        ResourceProviderOperationInner model =
            new ResourceProviderOperationInner()
                .withName("idybyxczf")
                .withDisplay(
                    new ResourceProviderOperationDisplay()
                        .withProvider("aaxdbabphlwrq")
                        .withResource("ktsthsucocmny")
                        .withOperation("zt")
                        .withDescription("twwrqp"));
        model = BinaryData.fromObject(model).toObject(ResourceProviderOperationInner.class);
        Assertions.assertEquals("idybyxczf", model.name());
        Assertions.assertEquals("aaxdbabphlwrq", model.display().provider());
        Assertions.assertEquals("ktsthsucocmny", model.display().resource());
        Assertions.assertEquals("zt", model.display().operation());
        Assertions.assertEquals("twwrqp", model.display().description());
    }
}
