// 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.JobDefinitionProperties;
import com.azure.resourcemanager.storagemover.models.CopyMode;
import org.junit.jupiter.api.Assertions;

public final class JobDefinitionPropertiesTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        JobDefinitionProperties model =
            BinaryData
                .fromString(
                    "{\"description\":\"ej\",\"copyMode\":\"Additive\",\"sourceName\":\"vorxzdmohct\",\"sourceResourceId\":\"vudwx\",\"sourceSubpath\":\"dnvowg\",\"targetName\":\"jjugwdkcglhslaz\",\"targetResourceId\":\"yggdtjixh\",\"targetSubpath\":\"uofqwe\",\"latestJobRunName\":\"hmenevfyexfwhybc\",\"latestJobRunResourceId\":\"vyvdcs\",\"latestJobRunStatus\":\"Running\",\"agentName\":\"naamde\",\"agentResourceId\":\"eh\",\"provisioningState\":\"Succeeded\"}")
                .toObject(JobDefinitionProperties.class);
        Assertions.assertEquals("ej", model.description());
        Assertions.assertEquals(CopyMode.ADDITIVE, model.copyMode());
        Assertions.assertEquals("vorxzdmohct", model.sourceName());
        Assertions.assertEquals("dnvowg", model.sourceSubpath());
        Assertions.assertEquals("jjugwdkcglhslaz", model.targetName());
        Assertions.assertEquals("uofqwe", model.targetSubpath());
        Assertions.assertEquals("naamde", model.agentName());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        JobDefinitionProperties model =
            new JobDefinitionProperties()
                .withDescription("ej")
                .withCopyMode(CopyMode.ADDITIVE)
                .withSourceName("vorxzdmohct")
                .withSourceSubpath("dnvowg")
                .withTargetName("jjugwdkcglhslaz")
                .withTargetSubpath("uofqwe")
                .withAgentName("naamde");
        model = BinaryData.fromObject(model).toObject(JobDefinitionProperties.class);
        Assertions.assertEquals("ej", model.description());
        Assertions.assertEquals(CopyMode.ADDITIVE, model.copyMode());
        Assertions.assertEquals("vorxzdmohct", model.sourceName());
        Assertions.assertEquals("dnvowg", model.sourceSubpath());
        Assertions.assertEquals("jjugwdkcglhslaz", model.targetName());
        Assertions.assertEquals("uofqwe", model.targetSubpath());
        Assertions.assertEquals("naamde", model.agentName());
    }
}
