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

package com.azure.resourcemanager.synapse.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.synapse.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\":\"Creating\",\"softDeletePeriod\":\"PT21H33M36S\",\"hotCachePeriod\":\"PT30H42M39S\",\"statistics\":{\"size\":1.7092168},\"leaderClusterResourceId\":\"azyqbxyxoyfp\",\"attachedDatabaseConfigurationName\":\"qi\",\"principalsModificationKind\":\"None\"}")
                .toObject(ReadOnlyFollowingDatabaseProperties.class);
        Assertions.assertEquals(Duration.parse("PT30H42M39S"), model.hotCachePeriod());
    }

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