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

public final class MoveRPAcrossTiersRequestTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        MoveRPAcrossTiersRequest model =
            BinaryData
                .fromString(
                    "{\"objectType\":\"gitvg\",\"sourceTierType\":\"InstantRP\",\"targetTierType\":\"ArchivedRP\"}")
                .toObject(MoveRPAcrossTiersRequest.class);
        Assertions.assertEquals("gitvg", model.objectType());
        Assertions.assertEquals(RecoveryPointTierType.INSTANT_RP, model.sourceTierType());
        Assertions.assertEquals(RecoveryPointTierType.ARCHIVED_RP, model.targetTierType());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        MoveRPAcrossTiersRequest model =
            new MoveRPAcrossTiersRequest()
                .withObjectType("gitvg")
                .withSourceTierType(RecoveryPointTierType.INSTANT_RP)
                .withTargetTierType(RecoveryPointTierType.ARCHIVED_RP);
        model = BinaryData.fromObject(model).toObject(MoveRPAcrossTiersRequest.class);
        Assertions.assertEquals("gitvg", model.objectType());
        Assertions.assertEquals(RecoveryPointTierType.INSTANT_RP, model.sourceTierType());
        Assertions.assertEquals(RecoveryPointTierType.ARCHIVED_RP, model.targetTierType());
    }
}
