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

package com.azure.resourcemanager.hybridcontainerservice.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.hybridcontainerservice.models.StorageSpacesProperties;
import com.azure.resourcemanager.hybridcontainerservice.models.StorageSpacesPropertiesHciStorageProfile;
import com.azure.resourcemanager.hybridcontainerservice.models.StorageSpacesPropertiesStatus;
import com.azure.resourcemanager.hybridcontainerservice.models.StorageSpacesPropertiesStatusProvisioningStatus;
import com.azure.resourcemanager.hybridcontainerservice.models.StorageSpacesPropertiesVmwareStorageProfile;
import org.junit.jupiter.api.Assertions;

public final class StorageSpacesPropertiesTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        StorageSpacesProperties model =
            BinaryData
                .fromString(
                    "{\"hciStorageProfile\":{\"mocGroup\":\"qkacewii\",\"mocLocation\":\"pubjibw\",\"mocStorageContainer\":\"f\"},\"vmwareStorageProfile\":{\"datacenter\":\"qkvpuvksgplsakn\",\"datastore\":\"fsynljphuop\",\"folder\":\"dlqiyntorzih\",\"resourcePool\":\"osjswsr\"},\"provisioningState\":\"Created\",\"status\":{\"provisioningStatus\":{\"operationId\":\"zbchckqqzqioxiy\",\"phase\":\"iizynkedyatrwyh\",\"status\":\"ibzyhwitsmyp\"}}}")
                .toObject(StorageSpacesProperties.class);
        Assertions.assertEquals("qkacewii", model.hciStorageProfile().mocGroup());
        Assertions.assertEquals("pubjibw", model.hciStorageProfile().mocLocation());
        Assertions.assertEquals("f", model.hciStorageProfile().mocStorageContainer());
        Assertions.assertEquals("qkvpuvksgplsakn", model.vmwareStorageProfile().datacenter());
        Assertions.assertEquals("fsynljphuop", model.vmwareStorageProfile().datastore());
        Assertions.assertEquals("dlqiyntorzih", model.vmwareStorageProfile().folder());
        Assertions.assertEquals("osjswsr", model.vmwareStorageProfile().resourcePool());
        Assertions.assertEquals("zbchckqqzqioxiy", model.status().provisioningStatus().operationId());
        Assertions.assertEquals("iizynkedyatrwyh", model.status().provisioningStatus().phase());
        Assertions.assertEquals("ibzyhwitsmyp", model.status().provisioningStatus().status());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        StorageSpacesProperties model =
            new StorageSpacesProperties()
                .withHciStorageProfile(
                    new StorageSpacesPropertiesHciStorageProfile()
                        .withMocGroup("qkacewii")
                        .withMocLocation("pubjibw")
                        .withMocStorageContainer("f"))
                .withVmwareStorageProfile(
                    new StorageSpacesPropertiesVmwareStorageProfile()
                        .withDatacenter("qkvpuvksgplsakn")
                        .withDatastore("fsynljphuop")
                        .withFolder("dlqiyntorzih")
                        .withResourcePool("osjswsr"))
                .withStatus(
                    new StorageSpacesPropertiesStatus()
                        .withProvisioningStatus(
                            new StorageSpacesPropertiesStatusProvisioningStatus()
                                .withOperationId("zbchckqqzqioxiy")
                                .withPhase("iizynkedyatrwyh")
                                .withStatus("ibzyhwitsmyp")));
        model = BinaryData.fromObject(model).toObject(StorageSpacesProperties.class);
        Assertions.assertEquals("qkacewii", model.hciStorageProfile().mocGroup());
        Assertions.assertEquals("pubjibw", model.hciStorageProfile().mocLocation());
        Assertions.assertEquals("f", model.hciStorageProfile().mocStorageContainer());
        Assertions.assertEquals("qkvpuvksgplsakn", model.vmwareStorageProfile().datacenter());
        Assertions.assertEquals("fsynljphuop", model.vmwareStorageProfile().datastore());
        Assertions.assertEquals("dlqiyntorzih", model.vmwareStorageProfile().folder());
        Assertions.assertEquals("osjswsr", model.vmwareStorageProfile().resourcePool());
        Assertions.assertEquals("zbchckqqzqioxiy", model.status().provisioningStatus().operationId());
        Assertions.assertEquals("iizynkedyatrwyh", model.status().provisioningStatus().phase());
        Assertions.assertEquals("ibzyhwitsmyp", model.status().provisioningStatus().status());
    }
}
