// 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.MigrateMISyncCompleteCommandOutput;
import com.azure.resourcemanager.datamigration.models.ReportableException;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;

public final class MigrateMISyncCompleteCommandOutputTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        MigrateMISyncCompleteCommandOutput model =
            BinaryData
                .fromString(
                    "{\"errors\":[{\"message\":\"ankixzbinjeput\",\"actionableMessage\":\"rywn\",\"filePath\":\"oqftiyqzrnkcq\",\"lineNumber\":\"xlwhzlsicoh\",\"hResult\":1969001145,\"stackTrace\":\"wvl\"},{\"message\":\"avwhheunm\",\"actionableMessage\":\"hgyxzkonoc\",\"filePath\":\"oklyaxuconuq\",\"lineNumber\":\"fkbey\",\"hResult\":1315033601,\"stackTrace\":\"mjmwvvjektcx\"},{\"message\":\"nhwlrsffrzpwvl\",\"actionableMessage\":\"q\",\"filePath\":\"iqylihkaetck\",\"lineNumber\":\"fcivfsnkym\",\"hResult\":1059821653,\"stackTrace\":\"hjfbebrjcxe\"},{\"message\":\"uwutttxfvjrbi\",\"actionableMessage\":\"hxepcyvahfnlj\",\"filePath\":\"qxj\",\"lineNumber\":\"ujqgidok\",\"hResult\":792619615,\"stackTrace\":\"yoxgvcltbgsnc\"}]}")
                .toObject(MigrateMISyncCompleteCommandOutput.class);
        Assertions.assertEquals("rywn", model.errors().get(0).actionableMessage());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        MigrateMISyncCompleteCommandOutput model =
            new MigrateMISyncCompleteCommandOutput()
                .withErrors(
                    Arrays
                        .asList(
                            new ReportableException().withActionableMessage("rywn"),
                            new ReportableException().withActionableMessage("hgyxzkonoc"),
                            new ReportableException().withActionableMessage("q"),
                            new ReportableException().withActionableMessage("hxepcyvahfnlj")));
        model = BinaryData.fromObject(model).toObject(MigrateMISyncCompleteCommandOutput.class);
        Assertions.assertEquals("rywn", model.errors().get(0).actionableMessage());
    }
}
