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

package com.azure.resourcemanager.storagemover.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.storagemover.fluent.models.JobDefinitionInner;
import com.azure.resourcemanager.storagemover.models.CopyMode;
import org.junit.jupiter.api.Assertions;

public final class JobDefinitionInnerTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        JobDefinitionInner model =
            BinaryData
                .fromString(
                    "{\"properties\":{\"description\":\"bqqwxrj\",\"copyMode\":\"Mirror\",\"sourceName\":\"al\",\"sourceResourceId\":\"wsubisnja\",\"sourceSubpath\":\"mngnzscxaqw\",\"targetName\":\"ochcbonqvpkvl\",\"targetResourceId\":\"njeaseipheofloke\",\"targetSubpath\":\"ienjbdlwtgr\",\"latestJobRunName\":\"djpjumasxazjpq\",\"latestJobRunResourceId\":\"gual\",\"latestJobRunStatus\":\"Canceling\",\"agentName\":\"hejjz\",\"agentResourceId\":\"dudgwdslfhot\",\"provisioningState\":\"Succeeded\"},\"id\":\"npwlbjnpg\",\"name\":\"cftadeh\",\"type\":\"nltyfsoppusuesnz\"}")
                .toObject(JobDefinitionInner.class);
        Assertions.assertEquals("bqqwxrj", model.description());
        Assertions.assertEquals(CopyMode.MIRROR, model.copyMode());
        Assertions.assertEquals("al", model.sourceName());
        Assertions.assertEquals("mngnzscxaqw", model.sourceSubpath());
        Assertions.assertEquals("ochcbonqvpkvl", model.targetName());
        Assertions.assertEquals("ienjbdlwtgr", model.targetSubpath());
        Assertions.assertEquals("hejjz", model.agentName());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        JobDefinitionInner model =
            new JobDefinitionInner()
                .withDescription("bqqwxrj")
                .withCopyMode(CopyMode.MIRROR)
                .withSourceName("al")
                .withSourceSubpath("mngnzscxaqw")
                .withTargetName("ochcbonqvpkvl")
                .withTargetSubpath("ienjbdlwtgr")
                .withAgentName("hejjz");
        model = BinaryData.fromObject(model).toObject(JobDefinitionInner.class);
        Assertions.assertEquals("bqqwxrj", model.description());
        Assertions.assertEquals(CopyMode.MIRROR, model.copyMode());
        Assertions.assertEquals("al", model.sourceName());
        Assertions.assertEquals("mngnzscxaqw", model.sourceSubpath());
        Assertions.assertEquals("ochcbonqvpkvl", model.targetName());
        Assertions.assertEquals("ienjbdlwtgr", model.targetSubpath());
        Assertions.assertEquals("hejjz", model.agentName());
    }
}
