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

package com.azure.resourcemanager.recoveryservicesbackup.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.recoveryservicesbackup.models.SqlDataDirectoryMapping;
import com.azure.resourcemanager.recoveryservicesbackup.models.SqlDataDirectoryType;
import org.junit.jupiter.api.Assertions;

public final class SqlDataDirectoryMappingTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        SqlDataDirectoryMapping model =
            BinaryData
                .fromString(
                    "{\"mappingType\":\"Log\",\"sourceLogicalName\":\"ndbnwieh\",\"sourcePath\":\"ewjwiuubw\",\"targetPath\":\"qsfapaqt\"}")
                .toObject(SqlDataDirectoryMapping.class);
        Assertions.assertEquals(SqlDataDirectoryType.LOG, model.mappingType());
        Assertions.assertEquals("ndbnwieh", model.sourceLogicalName());
        Assertions.assertEquals("ewjwiuubw", model.sourcePath());
        Assertions.assertEquals("qsfapaqt", model.targetPath());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        SqlDataDirectoryMapping model =
            new SqlDataDirectoryMapping()
                .withMappingType(SqlDataDirectoryType.LOG)
                .withSourceLogicalName("ndbnwieh")
                .withSourcePath("ewjwiuubw")
                .withTargetPath("qsfapaqt");
        model = BinaryData.fromObject(model).toObject(SqlDataDirectoryMapping.class);
        Assertions.assertEquals(SqlDataDirectoryType.LOG, model.mappingType());
        Assertions.assertEquals("ndbnwieh", model.sourceLogicalName());
        Assertions.assertEquals("ewjwiuubw", model.sourcePath());
        Assertions.assertEquals("qsfapaqt", model.targetPath());
    }
}
