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

package com.azure.resourcemanager.security.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.security.models.ConfigurationStatus;
import com.azure.resourcemanager.security.models.EnforcementSupport;
import com.azure.resourcemanager.security.models.RecommendationAction;
import com.azure.resourcemanager.security.models.VmRecommendation;
import org.junit.jupiter.api.Assertions;

public final class VmRecommendationTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        VmRecommendation model =
            BinaryData
                .fromString(
                    "{\"configurationStatus\":\"Configured\",\"recommendationAction\":\"Remove\",\"resourceId\":\"euvyinzqodfvpgs\",\"enforcementSupport\":\"NotSupported\"}")
                .toObject(VmRecommendation.class);
        Assertions.assertEquals(ConfigurationStatus.CONFIGURED, model.configurationStatus());
        Assertions.assertEquals(RecommendationAction.REMOVE, model.recommendationAction());
        Assertions.assertEquals("euvyinzqodfvpgs", model.resourceId());
        Assertions.assertEquals(EnforcementSupport.NOT_SUPPORTED, model.enforcementSupport());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        VmRecommendation model =
            new VmRecommendation()
                .withConfigurationStatus(ConfigurationStatus.CONFIGURED)
                .withRecommendationAction(RecommendationAction.REMOVE)
                .withResourceId("euvyinzqodfvpgs")
                .withEnforcementSupport(EnforcementSupport.NOT_SUPPORTED);
        model = BinaryData.fromObject(model).toObject(VmRecommendation.class);
        Assertions.assertEquals(ConfigurationStatus.CONFIGURED, model.configurationStatus());
        Assertions.assertEquals(RecommendationAction.REMOVE, model.recommendationAction());
        Assertions.assertEquals("euvyinzqodfvpgs", model.resourceId());
        Assertions.assertEquals(EnforcementSupport.NOT_SUPPORTED, model.enforcementSupport());
    }
}
