// 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.fluent.models.AzureBackupRecoveryPointResourceInner;
import com.azure.resourcemanager.dataprotection.models.AzureBackupRecoveryPoint;
import com.azure.resourcemanager.dataprotection.models.AzureBackupRecoveryPointResourceList;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;

public final class AzureBackupRecoveryPointResourceListTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        AzureBackupRecoveryPointResourceList model =
            BinaryData
                .fromString(
                    "{\"value\":[{\"properties\":{\"objectType\":\"AzureBackupRecoveryPoint\"},\"id\":\"fbxzpuzycisp\",\"name\":\"qzahmgkbrp\",\"type\":\"y\"},{\"properties\":{\"objectType\":\"AzureBackupRecoveryPoint\"},\"id\":\"bnuqqkpik\",\"name\":\"drgvtqagn\",\"type\":\"uynhijg\"},{\"properties\":{\"objectType\":\"AzureBackupRecoveryPoint\"},\"id\":\"bfs\",\"name\":\"arbu\",\"type\":\"rcvpnazzmhjrunmp\"}],\"nextLink\":\"tdbhrbnla\"}")
                .toObject(AzureBackupRecoveryPointResourceList.class);
        Assertions.assertEquals("tdbhrbnla", model.nextLink());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        AzureBackupRecoveryPointResourceList model =
            new AzureBackupRecoveryPointResourceList()
                .withNextLink("tdbhrbnla")
                .withValue(
                    Arrays
                        .asList(
                            new AzureBackupRecoveryPointResourceInner().withProperties(new AzureBackupRecoveryPoint()),
                            new AzureBackupRecoveryPointResourceInner().withProperties(new AzureBackupRecoveryPoint()),
                            new AzureBackupRecoveryPointResourceInner()
                                .withProperties(new AzureBackupRecoveryPoint())));
        model = BinaryData.fromObject(model).toObject(AzureBackupRecoveryPointResourceList.class);
        Assertions.assertEquals("tdbhrbnla", model.nextLink());
    }
}
