// 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.models.CencDrmConfiguration;
import com.azure.resourcemanager.mediaservices.models.StreamingPolicyPlayReadyConfiguration;
import com.azure.resourcemanager.mediaservices.models.StreamingPolicyWidevineConfiguration;
import org.junit.jupiter.api.Assertions;

public final class CencDrmConfigurationTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        CencDrmConfiguration model =
            BinaryData
                .fromString(
                    "{\"playReady\":{\"customLicenseAcquisitionUrlTemplate\":\"l\",\"playReadyCustomAttributes\":\"slqlfmmdn\"},\"widevine\":{\"customLicenseAcquisitionUrlTemplate\":\"lzpswiydm\"}}")
                .toObject(CencDrmConfiguration.class);
        Assertions.assertEquals("l", model.playReady().customLicenseAcquisitionUrlTemplate());
        Assertions.assertEquals("slqlfmmdn", model.playReady().playReadyCustomAttributes());
        Assertions.assertEquals("lzpswiydm", model.widevine().customLicenseAcquisitionUrlTemplate());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        CencDrmConfiguration model =
            new CencDrmConfiguration()
                .withPlayReady(
                    new StreamingPolicyPlayReadyConfiguration()
                        .withCustomLicenseAcquisitionUrlTemplate("l")
                        .withPlayReadyCustomAttributes("slqlfmmdn"))
                .withWidevine(
                    new StreamingPolicyWidevineConfiguration().withCustomLicenseAcquisitionUrlTemplate("lzpswiydm"));
        model = BinaryData.fromObject(model).toObject(CencDrmConfiguration.class);
        Assertions.assertEquals("l", model.playReady().customLicenseAcquisitionUrlTemplate());
        Assertions.assertEquals("slqlfmmdn", model.playReady().playReadyCustomAttributes());
        Assertions.assertEquals("lzpswiydm", model.widevine().customLicenseAcquisitionUrlTemplate());
    }
}
