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

package com.azure.resourcemanager.storagepool.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.storagepool.fluent.models.DiskPoolCreateProperties;
import com.azure.resourcemanager.storagepool.models.Disk;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;

public final class DiskPoolCreatePropertiesTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        DiskPoolCreateProperties model =
            BinaryData
                .fromString(
                    "{\"availabilityZones\":[\"dfgiot\",\"ftutqxlngxlefgu\"],\"disks\":[{\"id\":\"krxd\"},{\"id\":\"mi\"}],\"subnetId\":\"tthzrvqd\",\"additionalCapabilities\":[\"hjybigehoqfbo\"]}")
                .toObject(DiskPoolCreateProperties.class);
        Assertions.assertEquals("dfgiot", model.availabilityZones().get(0));
        Assertions.assertEquals("krxd", model.disks().get(0).id());
        Assertions.assertEquals("tthzrvqd", model.subnetId());
        Assertions.assertEquals("hjybigehoqfbo", model.additionalCapabilities().get(0));
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        DiskPoolCreateProperties model =
            new DiskPoolCreateProperties()
                .withAvailabilityZones(Arrays.asList("dfgiot", "ftutqxlngxlefgu"))
                .withDisks(Arrays.asList(new Disk().withId("krxd"), new Disk().withId("mi")))
                .withSubnetId("tthzrvqd")
                .withAdditionalCapabilities(Arrays.asList("hjybigehoqfbo"));
        model = BinaryData.fromObject(model).toObject(DiskPoolCreateProperties.class);
        Assertions.assertEquals("dfgiot", model.availabilityZones().get(0));
        Assertions.assertEquals("krxd", model.disks().get(0).id());
        Assertions.assertEquals("tthzrvqd", model.subnetId());
        Assertions.assertEquals("hjybigehoqfbo", model.additionalCapabilities().get(0));
    }
}
