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

package com.azure.resourcemanager.logic.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.logic.models.SetTriggerStateActionDefinition;
import com.azure.resourcemanager.logic.models.WorkflowTriggerReference;
import org.junit.jupiter.api.Assertions;

public final class SetTriggerStateActionDefinitionTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        SetTriggerStateActionDefinition model =
            BinaryData
                .fromString(
                    "{\"source\":{\"flowName\":\"dckzywbiexz\",\"triggerName\":\"yueaxibxujwb\",\"id\":\"walm\",\"name\":\"yoxa\",\"type\":\"dkzjancuxrh\"}}")
                .toObject(SetTriggerStateActionDefinition.class);
        Assertions.assertEquals("walm", model.source().id());
        Assertions.assertEquals("dckzywbiexz", model.source().flowName());
        Assertions.assertEquals("yueaxibxujwb", model.source().triggerName());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        SetTriggerStateActionDefinition model =
            new SetTriggerStateActionDefinition()
                .withSource(
                    new WorkflowTriggerReference()
                        .withId("walm")
                        .withFlowName("dckzywbiexz")
                        .withTriggerName("yueaxibxujwb"));
        model = BinaryData.fromObject(model).toObject(SetTriggerStateActionDefinition.class);
        Assertions.assertEquals("walm", model.source().id());
        Assertions.assertEquals("dckzywbiexz", model.source().flowName());
        Assertions.assertEquals("yueaxibxujwb", model.source().triggerName());
    }
}
