// 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.KubernetesClusterBackupDatasourceParameters;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;

public final class KubernetesClusterBackupDatasourceParametersTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        KubernetesClusterBackupDatasourceParameters model =
            BinaryData
                .fromString(
                    "{\"objectType\":\"KubernetesClusterBackupDatasourceParameters\",\"snapshotVolumes\":true,\"includeClusterScopeResources\":true,\"includedNamespaces\":[\"itqscywuggwoluhc\",\"bwemhairs\",\"rgzdwmsweyp\",\"w\"],\"excludedNamespaces\":[\"gicccnxqhuex\",\"ktt\",\"stvlzywemhzrnc\"],\"includedResourceTypes\":[\"clusiy\",\"bsfgytguslfea\",\"cy\",\"qukyhejhzi\"],\"excludedResourceTypes\":[\"fpel\",\"lppvksrpq\",\"ujzra\",\"htwdwrftswibyrcd\"],\"labelSelectors\":[\"shfwpracstwity\"]}")
                .toObject(KubernetesClusterBackupDatasourceParameters.class);
        Assertions.assertEquals(true, model.snapshotVolumes());
        Assertions.assertEquals(true, model.includeClusterScopeResources());
        Assertions.assertEquals("itqscywuggwoluhc", model.includedNamespaces().get(0));
        Assertions.assertEquals("gicccnxqhuex", model.excludedNamespaces().get(0));
        Assertions.assertEquals("clusiy", model.includedResourceTypes().get(0));
        Assertions.assertEquals("fpel", model.excludedResourceTypes().get(0));
        Assertions.assertEquals("shfwpracstwity", model.labelSelectors().get(0));
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        KubernetesClusterBackupDatasourceParameters model =
            new KubernetesClusterBackupDatasourceParameters()
                .withSnapshotVolumes(true)
                .withIncludeClusterScopeResources(true)
                .withIncludedNamespaces(Arrays.asList("itqscywuggwoluhc", "bwemhairs", "rgzdwmsweyp", "w"))
                .withExcludedNamespaces(Arrays.asList("gicccnxqhuex", "ktt", "stvlzywemhzrnc"))
                .withIncludedResourceTypes(Arrays.asList("clusiy", "bsfgytguslfea", "cy", "qukyhejhzi"))
                .withExcludedResourceTypes(Arrays.asList("fpel", "lppvksrpq", "ujzra", "htwdwrftswibyrcd"))
                .withLabelSelectors(Arrays.asList("shfwpracstwity"));
        model = BinaryData.fromObject(model).toObject(KubernetesClusterBackupDatasourceParameters.class);
        Assertions.assertEquals(true, model.snapshotVolumes());
        Assertions.assertEquals(true, model.includeClusterScopeResources());
        Assertions.assertEquals("itqscywuggwoluhc", model.includedNamespaces().get(0));
        Assertions.assertEquals("gicccnxqhuex", model.excludedNamespaces().get(0));
        Assertions.assertEquals("clusiy", model.includedResourceTypes().get(0));
        Assertions.assertEquals("fpel", model.excludedResourceTypes().get(0));
        Assertions.assertEquals("shfwpracstwity", model.labelSelectors().get(0));
    }
}
