// 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.OverwriteOptions;
import com.azure.resourcemanager.recoveryservicesbackup.models.TargetRestoreInfo;
import org.junit.jupiter.api.Assertions;

public final class TargetRestoreInfoTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        TargetRestoreInfo model =
            BinaryData
                .fromString(
                    "{\"overwriteOption\":\"FailOnConflict\",\"containerId\":\"qqs\",\"databaseName\":\"waoqvmmb\",\"targetDirectoryForFileRestore\":\"qfr\"}")
                .toObject(TargetRestoreInfo.class);
        Assertions.assertEquals(OverwriteOptions.FAIL_ON_CONFLICT, model.overwriteOption());
        Assertions.assertEquals("qqs", model.containerId());
        Assertions.assertEquals("waoqvmmb", model.databaseName());
        Assertions.assertEquals("qfr", model.targetDirectoryForFileRestore());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        TargetRestoreInfo model =
            new TargetRestoreInfo()
                .withOverwriteOption(OverwriteOptions.FAIL_ON_CONFLICT)
                .withContainerId("qqs")
                .withDatabaseName("waoqvmmb")
                .withTargetDirectoryForFileRestore("qfr");
        model = BinaryData.fromObject(model).toObject(TargetRestoreInfo.class);
        Assertions.assertEquals(OverwriteOptions.FAIL_ON_CONFLICT, model.overwriteOption());
        Assertions.assertEquals("qqs", model.containerId());
        Assertions.assertEquals("waoqvmmb", model.databaseName());
        Assertions.assertEquals("qfr", model.targetDirectoryForFileRestore());
    }
}
