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

package com.azure.resourcemanager.logic.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.logic.models.ApiDeploymentParameterMetadata;
import com.azure.resourcemanager.logic.models.ApiDeploymentParameterMetadataSet;
import com.azure.resourcemanager.logic.models.ApiDeploymentParameterVisibility;
import org.junit.jupiter.api.Assertions;

public final class ApiDeploymentParameterMetadataSetTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        ApiDeploymentParameterMetadataSet model =
            BinaryData
                .fromString(
                    "{\"packageContentLink\":{\"type\":\"sdaultxij\",\"isRequired\":false,\"displayName\":\"qwazlnqnmcjngzq\",\"description\":\"xtbjwgnyfusfzsv\",\"visibility\":\"Internal\"},\"redisCacheConnectionString\":{\"type\":\"hajqglcfh\",\"isRequired\":true,\"displayName\":\"ryxynqnzrd\",\"description\":\"ovw\",\"visibility\":\"Internal\"}}")
                .toObject(ApiDeploymentParameterMetadataSet.class);
        Assertions.assertEquals("sdaultxij", model.packageContentLink().type());
        Assertions.assertEquals(false, model.packageContentLink().isRequired());
        Assertions.assertEquals("qwazlnqnmcjngzq", model.packageContentLink().displayName());
        Assertions.assertEquals("xtbjwgnyfusfzsv", model.packageContentLink().description());
        Assertions.assertEquals(ApiDeploymentParameterVisibility.INTERNAL, model.packageContentLink().visibility());
        Assertions.assertEquals("hajqglcfh", model.redisCacheConnectionString().type());
        Assertions.assertEquals(true, model.redisCacheConnectionString().isRequired());
        Assertions.assertEquals("ryxynqnzrd", model.redisCacheConnectionString().displayName());
        Assertions.assertEquals("ovw", model.redisCacheConnectionString().description());
        Assertions
            .assertEquals(ApiDeploymentParameterVisibility.INTERNAL, model.redisCacheConnectionString().visibility());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        ApiDeploymentParameterMetadataSet model =
            new ApiDeploymentParameterMetadataSet()
                .withPackageContentLink(
                    new ApiDeploymentParameterMetadata()
                        .withType("sdaultxij")
                        .withIsRequired(false)
                        .withDisplayName("qwazlnqnmcjngzq")
                        .withDescription("xtbjwgnyfusfzsv")
                        .withVisibility(ApiDeploymentParameterVisibility.INTERNAL))
                .withRedisCacheConnectionString(
                    new ApiDeploymentParameterMetadata()
                        .withType("hajqglcfh")
                        .withIsRequired(true)
                        .withDisplayName("ryxynqnzrd")
                        .withDescription("ovw")
                        .withVisibility(ApiDeploymentParameterVisibility.INTERNAL));
        model = BinaryData.fromObject(model).toObject(ApiDeploymentParameterMetadataSet.class);
        Assertions.assertEquals("sdaultxij", model.packageContentLink().type());
        Assertions.assertEquals(false, model.packageContentLink().isRequired());
        Assertions.assertEquals("qwazlnqnmcjngzq", model.packageContentLink().displayName());
        Assertions.assertEquals("xtbjwgnyfusfzsv", model.packageContentLink().description());
        Assertions.assertEquals(ApiDeploymentParameterVisibility.INTERNAL, model.packageContentLink().visibility());
        Assertions.assertEquals("hajqglcfh", model.redisCacheConnectionString().type());
        Assertions.assertEquals(true, model.redisCacheConnectionString().isRequired());
        Assertions.assertEquals("ryxynqnzrd", model.redisCacheConnectionString().displayName());
        Assertions.assertEquals("ovw", model.redisCacheConnectionString().description());
        Assertions
            .assertEquals(ApiDeploymentParameterVisibility.INTERNAL, model.redisCacheConnectionString().visibility());
    }
}
