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

package com.azure.resourcemanager.security.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.security.fluent.models.SecurityConnectorProperties;
import com.azure.resourcemanager.security.models.CloudName;
import com.azure.resourcemanager.security.models.CloudOffering;
import com.azure.resourcemanager.security.models.EnvironmentData;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;

public final class SecurityConnectorPropertiesTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        SecurityConnectorProperties model =
            BinaryData
                .fromString(
                    "{\"hierarchyIdentifier\":\"okcvtlubses\",\"hierarchyIdentifierTrialEndDate\":\"2021-01-02T05:52:53Z\",\"environmentName\":\"GCP\",\"offerings\":[{\"offeringType\":\"CloudOffering\",\"description\":\"hunlpirykycnd\"}],\"environmentData\":{\"environmentType\":\"EnvironmentData\"}}")
                .toObject(SecurityConnectorProperties.class);
        Assertions.assertEquals("okcvtlubses", model.hierarchyIdentifier());
        Assertions.assertEquals(CloudName.GCP, model.environmentName());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        SecurityConnectorProperties model =
            new SecurityConnectorProperties()
                .withHierarchyIdentifier("okcvtlubses")
                .withEnvironmentName(CloudName.GCP)
                .withOfferings(Arrays.asList(new CloudOffering()))
                .withEnvironmentData(new EnvironmentData());
        model = BinaryData.fromObject(model).toObject(SecurityConnectorProperties.class);
        Assertions.assertEquals("okcvtlubses", model.hierarchyIdentifier());
        Assertions.assertEquals(CloudName.GCP, model.environmentName());
    }
}
