// 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.fluent.models.BaseBackupPolicyResourceInner;
import com.azure.resourcemanager.dataprotection.models.BaseBackupPolicy;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;

public final class BaseBackupPolicyResourceInnerTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        BaseBackupPolicyResourceInner model =
            BinaryData
                .fromString(
                    "{\"properties\":{\"objectType\":\"BaseBackupPolicy\",\"datasourceTypes\":[\"hm\",\"w\"]},\"id\":\"m\",\"name\":\"uhrzayvvt\",\"type\":\"gvdfgiotkftutq\"}")
                .toObject(BaseBackupPolicyResourceInner.class);
        Assertions.assertEquals("hm", model.properties().datasourceTypes().get(0));
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        BaseBackupPolicyResourceInner model =
            new BaseBackupPolicyResourceInner()
                .withProperties(new BaseBackupPolicy().withDatasourceTypes(Arrays.asList("hm", "w")));
        model = BinaryData.fromObject(model).toObject(BaseBackupPolicyResourceInner.class);
        Assertions.assertEquals("hm", model.properties().datasourceTypes().get(0));
    }
}
