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

public final class ReadOnlyFollowingDatabasePropertiesTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        ReadOnlyFollowingDatabaseProperties model =
            BinaryData
                .fromString(
                    "{\"provisioningState\":\"Canceled\",\"softDeletePeriod\":\"PT5H45M39S\",\"hotCachePeriod\":\"PT34H54M\",\"statistics\":{\"size\":24.823893},\"leaderClusterResourceId\":\"ojvdcpzfoqo\",\"attachedDatabaseConfigurationName\":\"cybxa\",\"principalsModificationKind\":\"Replace\",\"tableLevelSharingProperties\":{\"tablesToInclude\":[\"foxciq\",\"p\"],\"tablesToExclude\":[\"amcio\",\"hkh\"],\"externalTablesToInclude\":[\"khnzbonlw\",\"toego\",\"dwbwhkszzcmrvexz\",\"vbtqgsfraoyzk\"],\"externalTablesToExclude\":[\"tlmngu\"],\"materializedViewsToInclude\":[\"q\",\"ldsyuuximerqfob\"],\"materializedViewsToExclude\":[\"nkbykutwpfhp\",\"gmhrskdsnfdsdoak\",\"tdlmkkzevd\",\"hewpusdsttwv\"],\"functionsToInclude\":[\"bbejdcngqqm\",\"akufgmjz\",\"wr\"],\"functionsToExclude\":[\"twaenuuzko\",\"bminrfdwoyuhhzi\",\"iefozbhdmsml\"]},\"originalDatabaseName\":\"qhoftrmaequiah\",\"databaseShareOrigin\":\"DataShare\"}")
                .toObject(ReadOnlyFollowingDatabaseProperties.class);
        Assertions.assertEquals(Duration.parse("PT34H54M"), model.hotCachePeriod());
    }

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