// 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.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\":\"PT1H8M39S\",\"hotCachePeriod\":\"PT168H52M2S\",\"statistics\":{\"size\":48.76836},\"leaderClusterResourceId\":\"jufptbjczjnciuiy\",\"attachedDatabaseConfigurationName\":\"ldaswvpp\",\"principalsModificationKind\":\"None\"},\"location\":\"zlgcndhzxrrf\",\"id\":\"srhkhgsnxuwwkpph\",\"name\":\"fsbzxlbzxo\",\"type\":\"eikjclwza\"}")
                .toObject(ReadOnlyFollowingDatabase.class);
        Assertions.assertEquals("zlgcndhzxrrf", model.location());
        Assertions.assertEquals(Duration.parse("PT168H52M2S"), model.hotCachePeriod());
    }

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