// 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.AadProfileResponse;
import com.azure.resourcemanager.hybridcontainerservice.models.HttpProxyConfigResponse;
import com.azure.resourcemanager.hybridcontainerservice.models.LicenseType;
import com.azure.resourcemanager.hybridcontainerservice.models.ProvisionedClustersPropertiesWithoutSecrets;
import com.azure.resourcemanager.hybridcontainerservice.models.WindowsProfileResponse;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;

public final class ProvisionedClustersPropertiesWithoutSecretsTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        ProvisionedClustersPropertiesWithoutSecrets model =
            BinaryData
                .fromString(
                    "{\"aadProfile\":{\"adminGroupObjectIDs\":[\"bbkpodep\"],\"clientAppID\":\"ginuvamih\",\"enableAzureRbac\":true,\"managed\":true,\"serverAppID\":\"xzxtheo\",\"tenantID\":\"si\"},\"windowsProfile\":{\"adminUsername\":\"v\",\"enableCsiProxy\":false,\"licenseType\":\"Windows_Server\"},\"httpProxyConfig\":{\"httpProxy\":\"hungbwjzrnf\",\"httpsProxy\":\"xgispemvtzfkufu\",\"noProxy\":[\"ofx\",\"eofjaeqjh\"],\"trustedCa\":\"b\",\"username\":\"v\"}}")
                .toObject(ProvisionedClustersPropertiesWithoutSecrets.class);
        Assertions.assertEquals("bbkpodep", model.aadProfile().adminGroupObjectIDs().get(0));
        Assertions.assertEquals("ginuvamih", model.aadProfile().clientAppId());
        Assertions.assertEquals(true, model.aadProfile().enableAzureRbac());
        Assertions.assertEquals(true, model.aadProfile().managed());
        Assertions.assertEquals("xzxtheo", model.aadProfile().serverAppId());
        Assertions.assertEquals("si", model.aadProfile().tenantId());
        Assertions.assertEquals("v", model.windowsProfile().adminUsername());
        Assertions.assertEquals(false, model.windowsProfile().enableCsiProxy());
        Assertions.assertEquals(LicenseType.WINDOWS_SERVER, model.windowsProfile().licenseType());
        Assertions.assertEquals("hungbwjzrnf", model.httpProxyConfig().httpProxy());
        Assertions.assertEquals("xgispemvtzfkufu", model.httpProxyConfig().httpsProxy());
        Assertions.assertEquals("ofx", model.httpProxyConfig().noProxy().get(0));
        Assertions.assertEquals("b", model.httpProxyConfig().trustedCa());
        Assertions.assertEquals("v", model.httpProxyConfig().username());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        ProvisionedClustersPropertiesWithoutSecrets model =
            new ProvisionedClustersPropertiesWithoutSecrets()
                .withAadProfile(
                    new AadProfileResponse()
                        .withAdminGroupObjectIDs(Arrays.asList("bbkpodep"))
                        .withClientAppId("ginuvamih")
                        .withEnableAzureRbac(true)
                        .withManaged(true)
                        .withServerAppId("xzxtheo")
                        .withTenantId("si"))
                .withWindowsProfile(
                    new WindowsProfileResponse()
                        .withAdminUsername("v")
                        .withEnableCsiProxy(false)
                        .withLicenseType(LicenseType.WINDOWS_SERVER))
                .withHttpProxyConfig(
                    new HttpProxyConfigResponse()
                        .withHttpProxy("hungbwjzrnf")
                        .withHttpsProxy("xgispemvtzfkufu")
                        .withNoProxy(Arrays.asList("ofx", "eofjaeqjh"))
                        .withTrustedCa("b")
                        .withUsername("v"));
        model = BinaryData.fromObject(model).toObject(ProvisionedClustersPropertiesWithoutSecrets.class);
        Assertions.assertEquals("bbkpodep", model.aadProfile().adminGroupObjectIDs().get(0));
        Assertions.assertEquals("ginuvamih", model.aadProfile().clientAppId());
        Assertions.assertEquals(true, model.aadProfile().enableAzureRbac());
        Assertions.assertEquals(true, model.aadProfile().managed());
        Assertions.assertEquals("xzxtheo", model.aadProfile().serverAppId());
        Assertions.assertEquals("si", model.aadProfile().tenantId());
        Assertions.assertEquals("v", model.windowsProfile().adminUsername());
        Assertions.assertEquals(false, model.windowsProfile().enableCsiProxy());
        Assertions.assertEquals(LicenseType.WINDOWS_SERVER, model.windowsProfile().licenseType());
        Assertions.assertEquals("hungbwjzrnf", model.httpProxyConfig().httpProxy());
        Assertions.assertEquals("xgispemvtzfkufu", model.httpProxyConfig().httpsProxy());
        Assertions.assertEquals("ofx", model.httpProxyConfig().noProxy().get(0));
        Assertions.assertEquals("b", model.httpProxyConfig().trustedCa());
        Assertions.assertEquals("v", model.httpProxyConfig().username());
    }
}
