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

package com.azure.resourcemanager.containerservicefleet.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.containerservicefleet.models.ManagedClusterUpgradeSpec;
import com.azure.resourcemanager.containerservicefleet.models.ManagedClusterUpgradeType;
import org.junit.jupiter.api.Assertions;

public final class ManagedClusterUpgradeSpecTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        ManagedClusterUpgradeSpec model =
            BinaryData
                .fromString("{\"type\":\"NodeImageOnly\",\"kubernetesVersion\":\"nrosfqpte\"}")
                .toObject(ManagedClusterUpgradeSpec.class);
        Assertions.assertEquals(ManagedClusterUpgradeType.NODE_IMAGE_ONLY, model.type());
        Assertions.assertEquals("nrosfqpte", model.kubernetesVersion());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        ManagedClusterUpgradeSpec model =
            new ManagedClusterUpgradeSpec()
                .withType(ManagedClusterUpgradeType.NODE_IMAGE_ONLY)
                .withKubernetesVersion("nrosfqpte");
        model = BinaryData.fromObject(model).toObject(ManagedClusterUpgradeSpec.class);
        Assertions.assertEquals(ManagedClusterUpgradeType.NODE_IMAGE_ONLY, model.type());
        Assertions.assertEquals("nrosfqpte", model.kubernetesVersion());
    }
}
