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

package com.azure.resourcemanager.synapse.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.synapse.fluent.models.SqlPoolVulnerabilityAssessmentRuleBaselineProperties;
import com.azure.resourcemanager.synapse.models.SqlPoolVulnerabilityAssessmentRuleBaselineItem;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;

public final class SqlPoolVulnerabilityAssessmentRuleBaselinePropertiesTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        SqlPoolVulnerabilityAssessmentRuleBaselineProperties model =
            BinaryData
                .fromString(
                    "{\"baselineResults\":[{\"result\":[\"nrojlpijnkr\",\"frddhcrati\",\"zronasxift\",\"zq\"]},{\"result\":[\"hftwesgog\"]},{\"result\":[\"honnxkrlgnyhmos\",\"xkk\",\"thrrgh\",\"jbdhqxvc\"]},{\"result\":[\"frpdsofbshrns\"]}]}")
                .toObject(SqlPoolVulnerabilityAssessmentRuleBaselineProperties.class);
        Assertions.assertEquals("nrojlpijnkr", model.baselineResults().get(0).result().get(0));
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        SqlPoolVulnerabilityAssessmentRuleBaselineProperties model =
            new SqlPoolVulnerabilityAssessmentRuleBaselineProperties()
                .withBaselineResults(
                    Arrays
                        .asList(
                            new SqlPoolVulnerabilityAssessmentRuleBaselineItem()
                                .withResult(Arrays.asList("nrojlpijnkr", "frddhcrati", "zronasxift", "zq")),
                            new SqlPoolVulnerabilityAssessmentRuleBaselineItem().withResult(Arrays.asList("hftwesgog")),
                            new SqlPoolVulnerabilityAssessmentRuleBaselineItem()
                                .withResult(Arrays.asList("honnxkrlgnyhmos", "xkk", "thrrgh", "jbdhqxvc")),
                            new SqlPoolVulnerabilityAssessmentRuleBaselineItem()
                                .withResult(Arrays.asList("frpdsofbshrns"))));
        model = BinaryData.fromObject(model).toObject(SqlPoolVulnerabilityAssessmentRuleBaselineProperties.class);
        Assertions.assertEquals("nrojlpijnkr", model.baselineResults().get(0).result().get(0));
    }
}
