// 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.fluent.models.IntegrationAccountMapProperties;
import com.azure.resourcemanager.logic.models.IntegrationAccountMapPropertiesParametersSchema;
import com.azure.resourcemanager.logic.models.MapType;
import org.junit.jupiter.api.Assertions;

public final class IntegrationAccountMapPropertiesTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        IntegrationAccountMapProperties model =
            BinaryData
                .fromString(
                    "{\"mapType\":\"Xslt20\",\"parametersSchema\":{\"ref\":\"taugzxnfaa\"},\"createdTime\":\"2021-08-18T07:12:15Z\",\"changedTime\":\"2021-08-22T16:28:31Z\",\"content\":\"kdmkqjjlwuenvrkp\",\"contentType\":\"uaibrebqaaysj\",\"contentLink\":{\"uri\":\"qtnqtt\",\"contentVersion\":\"lwfffi\",\"contentSize\":7764702360859121907,\"contentHash\":{\"algorithm\":\"qmt\",\"value\":\"ltmm\"},\"metadata\":\"datahyeozphvwau\"},\"metadata\":\"datancyg\"}")
                .toObject(IntegrationAccountMapProperties.class);
        Assertions.assertEquals(MapType.XSLT20, model.mapType());
        Assertions.assertEquals("taugzxnfaa", model.parametersSchema().ref());
        Assertions.assertEquals("kdmkqjjlwuenvrkp", model.content());
        Assertions.assertEquals("uaibrebqaaysj", model.contentType());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        IntegrationAccountMapProperties model =
            new IntegrationAccountMapProperties()
                .withMapType(MapType.XSLT20)
                .withParametersSchema(new IntegrationAccountMapPropertiesParametersSchema().withRef("taugzxnfaa"))
                .withContent("kdmkqjjlwuenvrkp")
                .withContentType("uaibrebqaaysj")
                .withMetadata("datancyg");
        model = BinaryData.fromObject(model).toObject(IntegrationAccountMapProperties.class);
        Assertions.assertEquals(MapType.XSLT20, model.mapType());
        Assertions.assertEquals("taugzxnfaa", model.parametersSchema().ref());
        Assertions.assertEquals("kdmkqjjlwuenvrkp", model.content());
        Assertions.assertEquals("uaibrebqaaysj", model.contentType());
    }
}
