// 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.models.RuntimeScriptAction;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;

public final class RuntimeScriptActionTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        RuntimeScriptAction model =
            BinaryData
                .fromString(
                    "{\"name\":\"fqrvkdvjsllrmvvd\",\"uri\":\"watkpnpulexxb\",\"parameters\":\"wtruwiqzbqjvsovm\",\"roles\":[\"kacspkw\",\"hzdobpxjmflbvvnc\"],\"applicationName\":\"kcciwwzjuqkhr\"}")
                .toObject(RuntimeScriptAction.class);
        Assertions.assertEquals("fqrvkdvjsllrmvvd", model.name());
        Assertions.assertEquals("watkpnpulexxb", model.uri());
        Assertions.assertEquals("wtruwiqzbqjvsovm", model.parameters());
        Assertions.assertEquals("kacspkw", model.roles().get(0));
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        RuntimeScriptAction model =
            new RuntimeScriptAction()
                .withName("fqrvkdvjsllrmvvd")
                .withUri("watkpnpulexxb")
                .withParameters("wtruwiqzbqjvsovm")
                .withRoles(Arrays.asList("kacspkw", "hzdobpxjmflbvvnc"));
        model = BinaryData.fromObject(model).toObject(RuntimeScriptAction.class);
        Assertions.assertEquals("fqrvkdvjsllrmvvd", model.name());
        Assertions.assertEquals("watkpnpulexxb", model.uri());
        Assertions.assertEquals("wtruwiqzbqjvsovm", model.parameters());
        Assertions.assertEquals("kacspkw", model.roles().get(0));
    }
}
