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

package com.azure.resourcemanager.postgresqlflexibleserver.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.postgresqlflexibleserver.models.BackupSettings;
import com.azure.resourcemanager.postgresqlflexibleserver.models.BackupStoreDetails;
import com.azure.resourcemanager.postgresqlflexibleserver.models.LtrBackupRequest;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;

public final class LtrBackupRequestTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        LtrBackupRequest model =
            BinaryData
                .fromString(
                    "{\"targetDetails\":{\"sasUriList\":[\"eodkwobda\"]},\"backupSettings\":{\"backupName\":\"xtibqdxbxwakbog\"}}")
                .toObject(LtrBackupRequest.class);
        Assertions.assertEquals("xtibqdxbxwakbog", model.backupSettings().backupName());
        Assertions.assertEquals("eodkwobda", model.targetDetails().sasUriList().get(0));
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        LtrBackupRequest model =
            new LtrBackupRequest()
                .withBackupSettings(new BackupSettings().withBackupName("xtibqdxbxwakbog"))
                .withTargetDetails(new BackupStoreDetails().withSasUriList(Arrays.asList("eodkwobda")));
        model = BinaryData.fromObject(model).toObject(LtrBackupRequest.class);
        Assertions.assertEquals("xtibqdxbxwakbog", model.backupSettings().backupName());
        Assertions.assertEquals("eodkwobda", model.targetDetails().sasUriList().get(0));
    }
}
