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

package com.azure.resourcemanager.dataprotection.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.dataprotection.models.CrossSubscriptionRestoreSettings;
import com.azure.resourcemanager.dataprotection.models.CrossSubscriptionRestoreState;
import com.azure.resourcemanager.dataprotection.models.FeatureSettings;
import org.junit.jupiter.api.Assertions;

public final class FeatureSettingsTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        FeatureSettings model =
            BinaryData
                .fromString("{\"crossSubscriptionRestoreSettings\":{\"state\":\"Disabled\"}}")
                .toObject(FeatureSettings.class);
        Assertions
            .assertEquals(CrossSubscriptionRestoreState.DISABLED, model.crossSubscriptionRestoreSettings().state());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        FeatureSettings model =
            new FeatureSettings()
                .withCrossSubscriptionRestoreSettings(
                    new CrossSubscriptionRestoreSettings().withState(CrossSubscriptionRestoreState.DISABLED));
        model = BinaryData.fromObject(model).toObject(FeatureSettings.class);
        Assertions
            .assertEquals(CrossSubscriptionRestoreState.DISABLED, model.crossSubscriptionRestoreSettings().state());
    }
}
