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

package com.azure.resourcemanager.hdinsight.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.hdinsight.fluent.models.RuntimeScriptActionDetailInner;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;

public final class RuntimeScriptActionDetailInnerTests {
    @Test
    public void testDeserialize() {
        RuntimeScriptActionDetailInner model =
            BinaryData
                .fromString(
                    "{\"scriptExecutionId\":6042347797530197687,\"startTime\":\"w\",\"endTime\":\"kpnb\",\"status\":\"zejjoqk\",\"operation\":\"fhsxttaugz\",\"executionSummary\":[{\"status\":\"azpxdtnkdmkqjjl\",\"instanceCount\":1899473333},{\"status\":\"vrkpyouaibreb\",\"instanceCount\":1719378885},{\"status\":\"sj\",\"instanceCount\":1330578772},{\"status\":\"tnqttezlwfffiak\",\"instanceCount\":1860291958}],\"debugInformation\":\"qmt\",\"name\":\"d\",\"uri\":\"tmmjihyeozph\",\"parameters\":\"auyqncygupkv\",\"roles\":[\"mdscwxqupev\"],\"applicationName\":\"f\"}")
                .toObject(RuntimeScriptActionDetailInner.class);
        Assertions.assertEquals("d", model.name());
        Assertions.assertEquals("tmmjihyeozph", model.uri());
        Assertions.assertEquals("auyqncygupkv", model.parameters());
        Assertions.assertEquals("mdscwxqupev", model.roles().get(0));
    }

    @Test
    public void testSerialize() {
        RuntimeScriptActionDetailInner model =
            new RuntimeScriptActionDetailInner()
                .withName("d")
                .withUri("tmmjihyeozph")
                .withParameters("auyqncygupkv")
                .withRoles(Arrays.asList("mdscwxqupev"));
        model = BinaryData.fromObject(model).toObject(RuntimeScriptActionDetailInner.class);
        Assertions.assertEquals("d", model.name());
        Assertions.assertEquals("tmmjihyeozph", model.uri());
        Assertions.assertEquals("auyqncygupkv", model.parameters());
        Assertions.assertEquals("mdscwxqupev", model.roles().get(0));
    }
}
