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

package com.azure.resourcemanager.mediaservices.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.mediaservices.fluent.models.StorageEncryptedAssetDecryptionDataInner;
import com.azure.resourcemanager.mediaservices.models.AssetFileEncryptionMetadata;
import java.util.Arrays;
import java.util.UUID;
import org.junit.jupiter.api.Assertions;

public final class StorageEncryptedAssetDecryptionDataInnerTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        StorageEncryptedAssetDecryptionDataInner model =
            BinaryData
                .fromString(
                    "{\"assetFileEncryptionMetadata\":[{\"initializationVector\":\"fclhaaxdbabphlwr\",\"assetFileName\":\"fkts\",\"assetFileId\":\"09bc26ad-fb31-4a9f-b61c-4c5e0272bb68\"}]}")
                .toObject(StorageEncryptedAssetDecryptionDataInner.class);
        Assertions.assertEquals("fclhaaxdbabphlwr", model.assetFileEncryptionMetadata().get(0).initializationVector());
        Assertions.assertEquals("fkts", model.assetFileEncryptionMetadata().get(0).assetFileName());
        Assertions
            .assertEquals(
                UUID.fromString("09bc26ad-fb31-4a9f-b61c-4c5e0272bb68"),
                model.assetFileEncryptionMetadata().get(0).assetFileId());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        StorageEncryptedAssetDecryptionDataInner model =
            new StorageEncryptedAssetDecryptionDataInner()
                .withAssetFileEncryptionMetadata(
                    Arrays
                        .asList(
                            new AssetFileEncryptionMetadata()
                                .withInitializationVector("fclhaaxdbabphlwr")
                                .withAssetFileName("fkts")
                                .withAssetFileId(UUID.fromString("09bc26ad-fb31-4a9f-b61c-4c5e0272bb68"))));
        model = BinaryData.fromObject(model).toObject(StorageEncryptedAssetDecryptionDataInner.class);
        Assertions.assertEquals("fclhaaxdbabphlwr", model.assetFileEncryptionMetadata().get(0).initializationVector());
        Assertions.assertEquals("fkts", model.assetFileEncryptionMetadata().get(0).assetFileName());
        Assertions
            .assertEquals(
                UUID.fromString("09bc26ad-fb31-4a9f-b61c-4c5e0272bb68"),
                model.assetFileEncryptionMetadata().get(0).assetFileId());
    }
}
