// 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.DataMaskingRuleProperties;
import com.azure.resourcemanager.synapse.models.DataMaskingFunction;
import com.azure.resourcemanager.synapse.models.DataMaskingRuleState;
import org.junit.jupiter.api.Assertions;

public final class DataMaskingRulePropertiesTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        DataMaskingRuleProperties model =
            BinaryData
                .fromString(
                    "{\"id\":\"dznx\",\"aliasName\":\"dsrhnjiv\",\"ruleState\":\"Disabled\",\"schemaName\":\"tnovqfzgemjdftul\",\"tableName\":\"ltducea\",\"columnName\":\"tmczuomejwcwwqi\",\"maskingFunction\":\"SSN\",\"numberFrom\":\"ssxmojms\",\"numberTo\":\"kjprvk\",\"prefixSize\":\"fz\",\"suffixSize\":\"jyxgtczh\",\"replacementString\":\"dbsdshm\"}")
                .toObject(DataMaskingRuleProperties.class);
        Assertions.assertEquals("dsrhnjiv", model.aliasName());
        Assertions.assertEquals(DataMaskingRuleState.DISABLED, model.ruleState());
        Assertions.assertEquals("tnovqfzgemjdftul", model.schemaName());
        Assertions.assertEquals("ltducea", model.tableName());
        Assertions.assertEquals("tmczuomejwcwwqi", model.columnName());
        Assertions.assertEquals(DataMaskingFunction.SSN, model.maskingFunction());
        Assertions.assertEquals("ssxmojms", model.numberFrom());
        Assertions.assertEquals("kjprvk", model.numberTo());
        Assertions.assertEquals("fz", model.prefixSize());
        Assertions.assertEquals("jyxgtczh", model.suffixSize());
        Assertions.assertEquals("dbsdshm", model.replacementString());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        DataMaskingRuleProperties model =
            new DataMaskingRuleProperties()
                .withAliasName("dsrhnjiv")
                .withRuleState(DataMaskingRuleState.DISABLED)
                .withSchemaName("tnovqfzgemjdftul")
                .withTableName("ltducea")
                .withColumnName("tmczuomejwcwwqi")
                .withMaskingFunction(DataMaskingFunction.SSN)
                .withNumberFrom("ssxmojms")
                .withNumberTo("kjprvk")
                .withPrefixSize("fz")
                .withSuffixSize("jyxgtczh")
                .withReplacementString("dbsdshm");
        model = BinaryData.fromObject(model).toObject(DataMaskingRuleProperties.class);
        Assertions.assertEquals("dsrhnjiv", model.aliasName());
        Assertions.assertEquals(DataMaskingRuleState.DISABLED, model.ruleState());
        Assertions.assertEquals("tnovqfzgemjdftul", model.schemaName());
        Assertions.assertEquals("ltducea", model.tableName());
        Assertions.assertEquals("tmczuomejwcwwqi", model.columnName());
        Assertions.assertEquals(DataMaskingFunction.SSN, model.maskingFunction());
        Assertions.assertEquals("ssxmojms", model.numberFrom());
        Assertions.assertEquals("kjprvk", model.numberTo());
        Assertions.assertEquals("fz", model.prefixSize());
        Assertions.assertEquals("jyxgtczh", model.suffixSize());
        Assertions.assertEquals("dbsdshm", model.replacementString());
    }
}
