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

package com.azure.resourcemanager.networkcloud.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.networkcloud.models.BareMetalMachineCommandSpecification;
import com.azure.resourcemanager.networkcloud.models.BareMetalMachineRunDataExtractsParameters;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;

public final class BareMetalMachineRunDataExtractsParametersTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        BareMetalMachineRunDataExtractsParameters model =
            BinaryData
                .fromString(
                    "{\"commands\":[{\"arguments\":[\"wpgclrcivt\",\"oxfrkenxpmyyefr\",\"mpdnqqskawa\"],\"command\":\"qvmmbn\"},{\"arguments\":[\"rtql\"],\"command\":\"zmegnitgvk\"},{\"arguments\":[\"yqdrf\",\"gcealzxwh\",\"ansym\",\"yqhlwigdivbkbx\"],\"command\":\"omfaj\"}],\"limitTimeSeconds\":3204420245532219409}")
                .toObject(BareMetalMachineRunDataExtractsParameters.class);
        Assertions.assertEquals("wpgclrcivt", model.commands().get(0).arguments().get(0));
        Assertions.assertEquals("qvmmbn", model.commands().get(0).command());
        Assertions.assertEquals(3204420245532219409L, model.limitTimeSeconds());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        BareMetalMachineRunDataExtractsParameters model =
            new BareMetalMachineRunDataExtractsParameters()
                .withCommands(
                    Arrays
                        .asList(
                            new BareMetalMachineCommandSpecification()
                                .withArguments(Arrays.asList("wpgclrcivt", "oxfrkenxpmyyefr", "mpdnqqskawa"))
                                .withCommand("qvmmbn"),
                            new BareMetalMachineCommandSpecification()
                                .withArguments(Arrays.asList("rtql"))
                                .withCommand("zmegnitgvk"),
                            new BareMetalMachineCommandSpecification()
                                .withArguments(Arrays.asList("yqdrf", "gcealzxwh", "ansym", "yqhlwigdivbkbx"))
                                .withCommand("omfaj")))
                .withLimitTimeSeconds(3204420245532219409L);
        model = BinaryData.fromObject(model).toObject(BareMetalMachineRunDataExtractsParameters.class);
        Assertions.assertEquals("wpgclrcivt", model.commands().get(0).arguments().get(0));
        Assertions.assertEquals("qvmmbn", model.commands().get(0).command());
        Assertions.assertEquals(3204420245532219409L, model.limitTimeSeconds());
    }
}
