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

package com.azure.resourcemanager.dataprotection.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.dataprotection.models.AzureBackupRehydrationRequest;
import com.azure.resourcemanager.dataprotection.models.RehydrationPriority;
import org.junit.jupiter.api.Assertions;

public final class AzureBackupRehydrationRequestTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        AzureBackupRehydrationRequest model =
            BinaryData
                .fromString(
                    "{\"recoveryPointId\":\"nlqidybyxczf\",\"rehydrationPriority\":\"High\",\"rehydrationRetentionDuration\":\"aaxdbabphlwrq\"}")
                .toObject(AzureBackupRehydrationRequest.class);
        Assertions.assertEquals("nlqidybyxczf", model.recoveryPointId());
        Assertions.assertEquals(RehydrationPriority.HIGH, model.rehydrationPriority());
        Assertions.assertEquals("aaxdbabphlwrq", model.rehydrationRetentionDuration());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        AzureBackupRehydrationRequest model =
            new AzureBackupRehydrationRequest()
                .withRecoveryPointId("nlqidybyxczf")
                .withRehydrationPriority(RehydrationPriority.HIGH)
                .withRehydrationRetentionDuration("aaxdbabphlwrq");
        model = BinaryData.fromObject(model).toObject(AzureBackupRehydrationRequest.class);
        Assertions.assertEquals("nlqidybyxczf", model.recoveryPointId());
        Assertions.assertEquals(RehydrationPriority.HIGH, model.rehydrationPriority());
        Assertions.assertEquals("aaxdbabphlwrq", model.rehydrationRetentionDuration());
    }
}
