// 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.models.ReadOnlyFollowingDatabase;
import java.time.Duration;
import org.junit.jupiter.api.Assertions;

public final class ReadOnlyFollowingDatabaseTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        ReadOnlyFollowingDatabase model =
            BinaryData
                .fromString(
                    "{\"kind\":\"ReadOnlyFollowing\",\"properties\":{\"provisioningState\":\"Deleting\",\"softDeletePeriod\":\"PT120H53M35S\",\"hotCachePeriod\":\"PT231H33M59S\",\"statistics\":{\"size\":98.12985},\"leaderClusterResourceId\":\"vm\",\"attachedDatabaseConfigurationName\":\"paslthaqfxssmwu\",\"principalsModificationKind\":\"Replace\",\"tableLevelSharingProperties\":{\"tablesToInclude\":[\"ezpdrhneu\",\"owqkdwytisi\"],\"tablesToExclude\":[\"cgpik\"],\"externalTablesToInclude\":[\"mejzanlfzxia\",\"rmbzo\"],\"externalTablesToExclude\":[\"i\",\"rjqc\"],\"materializedViewsToInclude\":[\"zpfrla\",\"szrnwo\"],\"materializedViewsToExclude\":[\"dfpwpjylwbtlhfls\",\"cdhszf\"],\"functionsToInclude\":[\"bgofeljag\",\"qmqhldvriii\",\"jnalghf\",\"vtvsexsowueluq\"],\"functionsToExclude\":[\"hhxvrhmzkwpj\",\"wws\"]},\"originalDatabaseName\":\"ghftqsxhqxujxuk\",\"databaseShareOrigin\":\"Direct\"},\"location\":\"igrjguufzdm\",\"id\":\"yqtfihwh\",\"name\":\"otzi\",\"type\":\"gamv\"}")
                .toObject(ReadOnlyFollowingDatabase.class);
        Assertions.assertEquals("igrjguufzdm", model.location());
        Assertions.assertEquals(Duration.parse("PT231H33M59S"), model.hotCachePeriod());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        ReadOnlyFollowingDatabase model =
            new ReadOnlyFollowingDatabase()
                .withLocation("igrjguufzdm")
                .withHotCachePeriod(Duration.parse("PT231H33M59S"));
        model = BinaryData.fromObject(model).toObject(ReadOnlyFollowingDatabase.class);
        Assertions.assertEquals("igrjguufzdm", model.location());
        Assertions.assertEquals(Duration.parse("PT231H33M59S"), model.hotCachePeriod());
    }
}
