// 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.DiskPoolProperties;
import com.azure.resourcemanager.storagepool.models.Disk;
import com.azure.resourcemanager.storagepool.models.OperationalStatus;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;

public final class DiskPoolPropertiesTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        DiskPoolProperties model =
            BinaryData
                .fromString(
                    "{\"provisioningState\":\"Updating\",\"availabilityZones\":[\"norcjxvsnbyxqab\",\"mocpc\"],\"status\":\"Stopped"
                        + " (deallocated)\",\"disks\":[{\"id\":\"rzafbljjgpbtoqcj\"},{\"id\":\"klj\"}],\"subnetId\":\"vbqid\",\"additionalCapabilities\":[\"jzyulpk\",\"dj\"]}")
                .toObject(DiskPoolProperties.class);
        Assertions.assertEquals("norcjxvsnbyxqab", model.availabilityZones().get(0));
        Assertions.assertEquals(OperationalStatus.STOPPED_DEALLOCATED, model.status());
        Assertions.assertEquals("rzafbljjgpbtoqcj", model.disks().get(0).id());
        Assertions.assertEquals("vbqid", model.subnetId());
        Assertions.assertEquals("jzyulpk", model.additionalCapabilities().get(0));
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        DiskPoolProperties model =
            new DiskPoolProperties()
                .withAvailabilityZones(Arrays.asList("norcjxvsnbyxqab", "mocpc"))
                .withStatus(OperationalStatus.STOPPED_DEALLOCATED)
                .withDisks(Arrays.asList(new Disk().withId("rzafbljjgpbtoqcj"), new Disk().withId("klj")))
                .withSubnetId("vbqid")
                .withAdditionalCapabilities(Arrays.asList("jzyulpk", "dj"));
        model = BinaryData.fromObject(model).toObject(DiskPoolProperties.class);
        Assertions.assertEquals("norcjxvsnbyxqab", model.availabilityZones().get(0));
        Assertions.assertEquals(OperationalStatus.STOPPED_DEALLOCATED, model.status());
        Assertions.assertEquals("rzafbljjgpbtoqcj", model.disks().get(0).id());
        Assertions.assertEquals("vbqid", model.subnetId());
        Assertions.assertEquals("jzyulpk", model.additionalCapabilities().get(0));
    }
}
