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

package com.azure.resourcemanager.resourcemover.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.resourcemover.models.MoveResourceInputType;
import com.azure.resourcemanager.resourcemover.models.PrepareRequest;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;

public final class PrepareRequestTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        PrepareRequest model =
            BinaryData
                .fromString(
                    "{\"validateOnly\":true,\"moveResources\":[\"sbzjhcr\",\"evdphlxaol\",\"hqtrgqjbpf\"],\"moveResourceInputType\":\"MoveResourceId\"}")
                .toObject(PrepareRequest.class);
        Assertions.assertEquals(true, model.validateOnly());
        Assertions.assertEquals("sbzjhcr", model.moveResources().get(0));
        Assertions.assertEquals(MoveResourceInputType.MOVE_RESOURCE_ID, model.moveResourceInputType());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        PrepareRequest model =
            new PrepareRequest()
                .withValidateOnly(true)
                .withMoveResources(Arrays.asList("sbzjhcr", "evdphlxaol", "hqtrgqjbpf"))
                .withMoveResourceInputType(MoveResourceInputType.MOVE_RESOURCE_ID);
        model = BinaryData.fromObject(model).toObject(PrepareRequest.class);
        Assertions.assertEquals(true, model.validateOnly());
        Assertions.assertEquals("sbzjhcr", model.moveResources().get(0));
        Assertions.assertEquals(MoveResourceInputType.MOVE_RESOURCE_ID, model.moveResourceInputType());
    }
}
