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

package com.azure.resourcemanager.datamigration.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.datamigration.models.MigrateSyncCompleteCommandInput;
import com.azure.resourcemanager.datamigration.models.MigrateSyncCompleteCommandProperties;
import java.time.OffsetDateTime;
import org.junit.jupiter.api.Assertions;

public final class MigrateSyncCompleteCommandPropertiesTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        MigrateSyncCompleteCommandProperties model =
            BinaryData
                .fromString(
                    "{\"commandType\":\"Migrate.Sync.Complete.Database\",\"input\":{\"databaseName\":\"rxnjeaseipheofl\",\"commitTimeStamp\":\"2021-05-08T17:02:16Z\"},\"output\":{\"id\":\"ienjbdlwtgr\",\"errors\":[{\"message\":\"pj\",\"actionableMessage\":\"asxazjpqyegualhb\",\"filePath\":\"hejjz\",\"lineNumber\":\"dudgwdslfhot\",\"hResult\":470013493,\"stackTrace\":\"npwlbjnpg\"},{\"message\":\"ftadehxnltyfs\",\"actionableMessage\":\"pusuesn\",\"filePath\":\"dejbavo\",\"lineNumber\":\"zdmohctbqvu\",\"hResult\":624432997,\"stackTrace\":\"ndnvo\"},{\"message\":\"ujjugwdkcglh\",\"actionableMessage\":\"azjdyggd\",\"filePath\":\"ixhbkuofqweykhm\",\"lineNumber\":\"evfyexfwhybcib\",\"hResult\":153812125,\"stackTrace\":\"c\"},{\"message\":\"tynnaamdectehfi\",\"actionableMessage\":\"cj\",\"filePath\":\"pvhez\",\"lineNumber\":\"gqhcjrefovg\",\"hResult\":668805249,\"stackTrace\":\"leyyvx\"}]},\"errors\":[],\"state\":\"Running\"}")
                .toObject(MigrateSyncCompleteCommandProperties.class);
        Assertions.assertEquals("rxnjeaseipheofl", model.input().databaseName());
        Assertions.assertEquals(OffsetDateTime.parse("2021-05-08T17:02:16Z"), model.input().commitTimestamp());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        MigrateSyncCompleteCommandProperties model =
            new MigrateSyncCompleteCommandProperties()
                .withInput(
                    new MigrateSyncCompleteCommandInput()
                        .withDatabaseName("rxnjeaseipheofl")
                        .withCommitTimestamp(OffsetDateTime.parse("2021-05-08T17:02:16Z")));
        model = BinaryData.fromObject(model).toObject(MigrateSyncCompleteCommandProperties.class);
        Assertions.assertEquals("rxnjeaseipheofl", model.input().databaseName());
        Assertions.assertEquals(OffsetDateTime.parse("2021-05-08T17:02:16Z"), model.input().commitTimestamp());
    }
}
