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

public final class WorkflowTriggerCallbackUrlInnerTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        WorkflowTriggerCallbackUrlInner model =
            BinaryData
                .fromString(
                    "{\"value\":\"nxkrx\",\"method\":\"mi\",\"basePath\":\"thz\",\"relativePath\":\"qdrabhjybigehoqf\",\"relativePathParameters\":[\"skanyk\"],\"queries\":{\"api-version\":\"cuiywgqyw\",\"sp\":\"drvyn\",\"sv\":\"gpphrcgyn\",\"sig\":\"cpecfvmmcoofs\",\"se\":\"zevgb\"}}")
                .toObject(WorkflowTriggerCallbackUrlInner.class);
        Assertions.assertEquals("skanyk", model.relativePathParameters().get(0));
        Assertions.assertEquals("cuiywgqyw", model.queries().apiVersion());
        Assertions.assertEquals("drvyn", model.queries().sp());
        Assertions.assertEquals("gpphrcgyn", model.queries().sv());
        Assertions.assertEquals("cpecfvmmcoofs", model.queries().sig());
        Assertions.assertEquals("zevgb", model.queries().se());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        WorkflowTriggerCallbackUrlInner model =
            new WorkflowTriggerCallbackUrlInner()
                .withRelativePathParameters(Arrays.asList("skanyk"))
                .withQueries(
                    new WorkflowTriggerListCallbackUrlQueries()
                        .withApiVersion("cuiywgqyw")
                        .withSp("drvyn")
                        .withSv("gpphrcgyn")
                        .withSig("cpecfvmmcoofs")
                        .withSe("zevgb"));
        model = BinaryData.fromObject(model).toObject(WorkflowTriggerCallbackUrlInner.class);
        Assertions.assertEquals("skanyk", model.relativePathParameters().get(0));
        Assertions.assertEquals("cuiywgqyw", model.queries().apiVersion());
        Assertions.assertEquals("drvyn", model.queries().sp());
        Assertions.assertEquals("gpphrcgyn", model.queries().sv());
        Assertions.assertEquals("cpecfvmmcoofs", model.queries().sig());
        Assertions.assertEquals("zevgb", model.queries().se());
    }
}
