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

public final class DataMaskingRuleInnerTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        DataMaskingRuleInner model =
            BinaryData
                .fromString(
                    "{\"properties\":{\"id\":\"mrhublwpc\",\"aliasName\":\"utr\",\"ruleState\":\"Disabled\",\"schemaName\":\"pauutpw\",\"tableName\":\"qhih\",\"columnName\":\"jqgwzp\",\"maskingFunction\":\"CCN\",\"numberFrom\":\"n\",\"numberTo\":\"ypsxjvfoim\",\"prefixSize\":\"slirciz\",\"suffixSize\":\"vydfceacvlhvygdy\",\"replacementString\":\"umrtwnawjsl\"},\"location\":\"wkojgcyztsfmzn\",\"kind\":\"eqphchqnrnr\",\"id\":\"x\",\"name\":\"huwrykqgaifm\",\"type\":\"iklbydvkhb\"}")
                .toObject(DataMaskingRuleInner.class);
        Assertions.assertEquals("utr", model.aliasName());
        Assertions.assertEquals(DataMaskingRuleState.DISABLED, model.ruleState());
        Assertions.assertEquals("pauutpw", model.schemaName());
        Assertions.assertEquals("qhih", model.tableName());
        Assertions.assertEquals("jqgwzp", model.columnName());
        Assertions.assertEquals(DataMaskingFunction.CCN, model.maskingFunction());
        Assertions.assertEquals("n", model.numberFrom());
        Assertions.assertEquals("ypsxjvfoim", model.numberTo());
        Assertions.assertEquals("slirciz", model.prefixSize());
        Assertions.assertEquals("vydfceacvlhvygdy", model.suffixSize());
        Assertions.assertEquals("umrtwnawjsl", model.replacementString());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        DataMaskingRuleInner model =
            new DataMaskingRuleInner()
                .withAliasName("utr")
                .withRuleState(DataMaskingRuleState.DISABLED)
                .withSchemaName("pauutpw")
                .withTableName("qhih")
                .withColumnName("jqgwzp")
                .withMaskingFunction(DataMaskingFunction.CCN)
                .withNumberFrom("n")
                .withNumberTo("ypsxjvfoim")
                .withPrefixSize("slirciz")
                .withSuffixSize("vydfceacvlhvygdy")
                .withReplacementString("umrtwnawjsl");
        model = BinaryData.fromObject(model).toObject(DataMaskingRuleInner.class);
        Assertions.assertEquals("utr", model.aliasName());
        Assertions.assertEquals(DataMaskingRuleState.DISABLED, model.ruleState());
        Assertions.assertEquals("pauutpw", model.schemaName());
        Assertions.assertEquals("qhih", model.tableName());
        Assertions.assertEquals("jqgwzp", model.columnName());
        Assertions.assertEquals(DataMaskingFunction.CCN, model.maskingFunction());
        Assertions.assertEquals("n", model.numberFrom());
        Assertions.assertEquals("ypsxjvfoim", model.numberTo());
        Assertions.assertEquals("slirciz", model.prefixSize());
        Assertions.assertEquals("vydfceacvlhvygdy", model.suffixSize());
        Assertions.assertEquals("umrtwnawjsl", model.replacementString());
    }
}
