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

package com.azure.resourcemanager.databoxedge.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.databoxedge.models.FileEventTrigger;
import com.azure.resourcemanager.databoxedge.models.FileSourceInfo;
import com.azure.resourcemanager.databoxedge.models.RoleSinkInfo;
import org.junit.jupiter.api.Assertions;

public final class FileEventTriggerTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        FileEventTrigger model =
            BinaryData
                .fromString(
                    "{\"kind\":\"FileEvent\",\"properties\":{\"sourceInfo\":{\"shareId\":\"cormr\"},\"sinkInfo\":{\"roleId\":\"xqtvcofu\"},\"customContextTag\":\"lvkgju\"},\"id\":\"gdknnqv\",\"name\":\"aznqntoru\",\"type\":\"sgsahmkycgr\"}")
                .toObject(FileEventTrigger.class);
        Assertions.assertEquals("cormr", model.sourceInfo().shareId());
        Assertions.assertEquals("xqtvcofu", model.sinkInfo().roleId());
        Assertions.assertEquals("lvkgju", model.customContextTag());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        FileEventTrigger model =
            new FileEventTrigger()
                .withSourceInfo(new FileSourceInfo().withShareId("cormr"))
                .withSinkInfo(new RoleSinkInfo().withRoleId("xqtvcofu"))
                .withCustomContextTag("lvkgju");
        model = BinaryData.fromObject(model).toObject(FileEventTrigger.class);
        Assertions.assertEquals("cormr", model.sourceInfo().shareId());
        Assertions.assertEquals("xqtvcofu", model.sinkInfo().roleId());
        Assertions.assertEquals("lvkgju", model.customContextTag());
    }
}
