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

package com.azure.resourcemanager.batch.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.batch.models.DiskEncryptionConfiguration;
import com.azure.resourcemanager.batch.models.DiskEncryptionTarget;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;

public final class DiskEncryptionConfigurationTests {
    @Test
    public void testDeserialize() {
        DiskEncryptionConfiguration model =
            BinaryData
                .fromString("{\"targets\":[\"TemporaryDisk\",\"OsDisk\"]}")
                .toObject(DiskEncryptionConfiguration.class);
        Assertions.assertEquals(DiskEncryptionTarget.TEMPORARY_DISK, model.targets().get(0));
    }

    @Test
    public void testSerialize() {
        DiskEncryptionConfiguration model =
            new DiskEncryptionConfiguration()
                .withTargets(Arrays.asList(DiskEncryptionTarget.TEMPORARY_DISK, DiskEncryptionTarget.OS_DISK));
        model = BinaryData.fromObject(model).toObject(DiskEncryptionConfiguration.class);
        Assertions.assertEquals(DiskEncryptionTarget.TEMPORARY_DISK, model.targets().get(0));
    }
}
