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

package com.azure.resourcemanager.managementgroups.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.managementgroups.models.HierarchySettingsInfo;
import org.junit.jupiter.api.Assertions;

public final class HierarchySettingsInfoTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        HierarchySettingsInfo model =
            BinaryData
                .fromString(
                    "{\"id\":\"wzjuqk\",\"type\":\"sa\",\"name\":\"wkuofoskghsauu\",\"properties\":{\"tenantId\":\"mvxi\",\"requireAuthorizationForGroupCreation\":true,\"defaultManagementGroup\":\"gidyjrrf\"}}")
                .toObject(HierarchySettingsInfo.class);
        Assertions.assertEquals("mvxi", model.tenantId());
        Assertions.assertEquals(true, model.requireAuthorizationForGroupCreation());
        Assertions.assertEquals("gidyjrrf", model.defaultManagementGroup());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        HierarchySettingsInfo model =
            new HierarchySettingsInfo()
                .withTenantId("mvxi")
                .withRequireAuthorizationForGroupCreation(true)
                .withDefaultManagementGroup("gidyjrrf");
        model = BinaryData.fromObject(model).toObject(HierarchySettingsInfo.class);
        Assertions.assertEquals("mvxi", model.tenantId());
        Assertions.assertEquals(true, model.requireAuthorizationForGroupCreation());
        Assertions.assertEquals("gidyjrrf", model.defaultManagementGroup());
    }
}
