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

package com.azure.resourcemanager.kusto.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.kusto.fluent.models.FollowerDatabaseDefinitionInner;
import com.azure.resourcemanager.kusto.models.FollowerDatabaseListResult;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;

public final class FollowerDatabaseListResultTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        FollowerDatabaseListResult model =
            BinaryData
                .fromString(
                    "{\"value\":[{\"clusterResourceId\":\"jbznorc\",\"attachedDatabaseConfigurationName\":\"xv\",\"databaseName\":\"byxqabn\",\"tableLevelSharingProperties\":{\"tablesToInclude\":[\"cyshurzafbljjgp\",\"toqcjmklja\"],\"tablesToExclude\":[\"idtqajzyu\",\"pku\",\"jkrlkhbzhfepg\"],\"externalTablesToInclude\":[\"e\"],\"externalTablesToExclude\":[\"ocxscpaierhhbcs\"],\"materializedViewsToInclude\":[\"mmajtjaodx\",\"bnbdxkqpxokajion\",\"imexgstxgcpodgma\"],\"materializedViewsToExclude\":[\"mvdjwzrlovmc\"],\"functionsToInclude\":[\"ijcoejctb\",\"aqsqsycbkbfk\"],\"functionsToExclude\":[\"dkexxppofm\",\"axcfjpgddtocjjx\"]},\"databaseShareOrigin\":\"DataShare\"}]}")
                .toObject(FollowerDatabaseListResult.class);
        Assertions.assertEquals("jbznorc", model.value().get(0).clusterResourceId());
        Assertions.assertEquals("xv", model.value().get(0).attachedDatabaseConfigurationName());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        FollowerDatabaseListResult model =
            new FollowerDatabaseListResult()
                .withValue(
                    Arrays
                        .asList(
                            new FollowerDatabaseDefinitionInner()
                                .withClusterResourceId("jbznorc")
                                .withAttachedDatabaseConfigurationName("xv")));
        model = BinaryData.fromObject(model).toObject(FollowerDatabaseListResult.class);
        Assertions.assertEquals("jbznorc", model.value().get(0).clusterResourceId());
        Assertions.assertEquals("xv", model.value().get(0).attachedDatabaseConfigurationName());
    }
}
