// 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.fluent.models.WorkflowTriggerInner;
import com.azure.resourcemanager.logic.models.WorkflowTriggerListResult;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;

public final class WorkflowTriggerListResultTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        WorkflowTriggerListResult model =
            BinaryData
                .fromString(
                    "{\"value\":[{\"properties\":{\"provisioningState\":\"Deleted\",\"createdTime\":\"2021-03-25T08:46:02Z\",\"changedTime\":\"2021-05-30T04:32:56Z\",\"state\":\"Deleted\",\"status\":\"NotSpecified\",\"lastExecutionTime\":\"2021-05-05T10:08:59Z\",\"nextExecutionTime\":\"2020-12-31T23:44:32Z\"},\"name\":\"p\",\"type\":\"g\",\"id\":\"pbuxwgipwhon\"},{\"properties\":{\"provisioningState\":\"Canceled\",\"createdTime\":\"2021-09-21T08:55:02Z\",\"changedTime\":\"2021-05-17T00:15:40Z\",\"state\":\"Disabled\",\"status\":\"Failed\",\"lastExecutionTime\":\"2021-07-23T09:11:59Z\",\"nextExecutionTime\":\"2021-05-01T14:47:46Z\"},\"name\":\"uttmrywnuzoqft\",\"type\":\"qzrnkcqvyxlwhz\",\"id\":\"icohoqqnwvl\"},{\"properties\":{\"provisioningState\":\"Succeeded\",\"createdTime\":\"2021-12-07T06:57Z\",\"changedTime\":\"2021-11-18T07:56:25Z\",\"state\":\"NotSpecified\",\"status\":\"Ignored\",\"lastExecutionTime\":\"2020-12-26T14:51:32Z\",\"nextExecutionTime\":\"2021-11-09T07:05:36Z\"},\"name\":\"onocukok\",\"type\":\"axuconuq\",\"id\":\"fkbey\"}],\"nextLink\":\"wrmjmwvvjektc\"}")
                .toObject(WorkflowTriggerListResult.class);
        Assertions.assertEquals("pbuxwgipwhon", model.value().get(0).id());
        Assertions.assertEquals("wrmjmwvvjektc", model.nextLink());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        WorkflowTriggerListResult model =
            new WorkflowTriggerListResult()
                .withValue(
                    Arrays
                        .asList(
                            new WorkflowTriggerInner().withId("pbuxwgipwhon"),
                            new WorkflowTriggerInner().withId("icohoqqnwvl"),
                            new WorkflowTriggerInner().withId("fkbey")))
                .withNextLink("wrmjmwvvjektc");
        model = BinaryData.fromObject(model).toObject(WorkflowTriggerListResult.class);
        Assertions.assertEquals("pbuxwgipwhon", model.value().get(0).id());
        Assertions.assertEquals("wrmjmwvvjektc", model.nextLink());
    }
}
