// 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.models.DefenderFoDatabasesAwsOfferingArcAutoProvisioning;
import com.azure.resourcemanager.security.models.DefenderFoDatabasesAwsOfferingArcAutoProvisioningConfiguration;
import org.junit.jupiter.api.Assertions;

public final class DefenderFoDatabasesAwsOfferingArcAutoProvisioningTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        DefenderFoDatabasesAwsOfferingArcAutoProvisioning model =
            BinaryData
                .fromString(
                    "{\"enabled\":true,\"cloudRoleArn\":\"kt\",\"configuration\":{\"proxy\":\"jwzzoslpk\",\"privateLinkScope\":\"tglwkzpgajsqjc\"}}")
                .toObject(DefenderFoDatabasesAwsOfferingArcAutoProvisioning.class);
        Assertions.assertEquals(true, model.enabled());
        Assertions.assertEquals("kt", model.cloudRoleArn());
        Assertions.assertEquals("jwzzoslpk", model.configuration().proxy());
        Assertions.assertEquals("tglwkzpgajsqjc", model.configuration().privateLinkScope());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        DefenderFoDatabasesAwsOfferingArcAutoProvisioning model =
            new DefenderFoDatabasesAwsOfferingArcAutoProvisioning()
                .withEnabled(true)
                .withCloudRoleArn("kt")
                .withConfiguration(
                    new DefenderFoDatabasesAwsOfferingArcAutoProvisioningConfiguration()
                        .withProxy("jwzzoslpk")
                        .withPrivateLinkScope("tglwkzpgajsqjc"));
        model = BinaryData.fromObject(model).toObject(DefenderFoDatabasesAwsOfferingArcAutoProvisioning.class);
        Assertions.assertEquals(true, model.enabled());
        Assertions.assertEquals("kt", model.cloudRoleArn());
        Assertions.assertEquals("jwzzoslpk", model.configuration().proxy());
        Assertions.assertEquals("tglwkzpgajsqjc", model.configuration().privateLinkScope());
    }
}
