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

package com.azure.resourcemanager.machinelearning.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.machinelearning.models.ScriptReference;
import com.azure.resourcemanager.machinelearning.models.ScriptsToExecute;
import com.azure.resourcemanager.machinelearning.models.SetupScripts;
import org.junit.jupiter.api.Assertions;

public final class SetupScriptsTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        SetupScripts model =
            BinaryData
                .fromString(
                    "{\"scripts\":{\"startupScript\":{\"scriptSource\":\"otjewlpxuzzjgnre\",\"scriptData\":\"yhqotoihiqakydi\",\"scriptArguments\":\"brkwpzdqt\",\"timeout\":\"cspodaqax\"},\"creationScript\":{\"scriptSource\":\"ietgbebjfu\",\"scriptData\":\"moichdlpnfpubntn\",\"scriptArguments\":\"tzviqsowsaaelcat\",\"timeout\":\"ju\"}}}")
                .toObject(SetupScripts.class);
        Assertions.assertEquals("otjewlpxuzzjgnre", model.scripts().startupScript().scriptSource());
        Assertions.assertEquals("yhqotoihiqakydi", model.scripts().startupScript().scriptData());
        Assertions.assertEquals("brkwpzdqt", model.scripts().startupScript().scriptArguments());
        Assertions.assertEquals("cspodaqax", model.scripts().startupScript().timeout());
        Assertions.assertEquals("ietgbebjfu", model.scripts().creationScript().scriptSource());
        Assertions.assertEquals("moichdlpnfpubntn", model.scripts().creationScript().scriptData());
        Assertions.assertEquals("tzviqsowsaaelcat", model.scripts().creationScript().scriptArguments());
        Assertions.assertEquals("ju", model.scripts().creationScript().timeout());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        SetupScripts model =
            new SetupScripts()
                .withScripts(
                    new ScriptsToExecute()
                        .withStartupScript(
                            new ScriptReference()
                                .withScriptSource("otjewlpxuzzjgnre")
                                .withScriptData("yhqotoihiqakydi")
                                .withScriptArguments("brkwpzdqt")
                                .withTimeout("cspodaqax"))
                        .withCreationScript(
                            new ScriptReference()
                                .withScriptSource("ietgbebjfu")
                                .withScriptData("moichdlpnfpubntn")
                                .withScriptArguments("tzviqsowsaaelcat")
                                .withTimeout("ju")));
        model = BinaryData.fromObject(model).toObject(SetupScripts.class);
        Assertions.assertEquals("otjewlpxuzzjgnre", model.scripts().startupScript().scriptSource());
        Assertions.assertEquals("yhqotoihiqakydi", model.scripts().startupScript().scriptData());
        Assertions.assertEquals("brkwpzdqt", model.scripts().startupScript().scriptArguments());
        Assertions.assertEquals("cspodaqax", model.scripts().startupScript().timeout());
        Assertions.assertEquals("ietgbebjfu", model.scripts().creationScript().scriptSource());
        Assertions.assertEquals("moichdlpnfpubntn", model.scripts().creationScript().scriptData());
        Assertions.assertEquals("tzviqsowsaaelcat", model.scripts().creationScript().scriptArguments());
        Assertions.assertEquals("ju", model.scripts().creationScript().timeout());
    }
}
