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

package com.azure.resourcemanager.machinelearning.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.machinelearning.models.DataLakeAnalytics;
import com.azure.resourcemanager.machinelearning.models.DataLakeAnalyticsSchemaProperties;
import org.junit.jupiter.api.Assertions;

public final class DataLakeAnalyticsTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        DataLakeAnalytics model =
            BinaryData
                .fromString(
                    "{\"computeType\":\"DataLakeAnalytics\",\"properties\":{\"dataLakeStoreAccountName\":\"wrxaomzisg\"},\"computeLocation\":\"rczezkhhlt\",\"provisioningState\":\"Deleting\",\"description\":\"hqo\",\"createdOn\":\"2021-11-21T17:40:44Z\",\"modifiedOn\":\"2021-08-05T21:29:34Z\",\"resourceId\":\"ueayfbpcmsplb\",\"provisioningErrors\":[],\"isAttachedCompute\":false,\"disableLocalAuth\":true}")
                .toObject(DataLakeAnalytics.class);
        Assertions.assertEquals("rczezkhhlt", model.computeLocation());
        Assertions.assertEquals("hqo", model.description());
        Assertions.assertEquals("ueayfbpcmsplb", model.resourceId());
        Assertions.assertEquals(true, model.disableLocalAuth());
        Assertions.assertEquals("wrxaomzisg", model.properties().dataLakeStoreAccountName());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        DataLakeAnalytics model =
            new DataLakeAnalytics()
                .withComputeLocation("rczezkhhlt")
                .withDescription("hqo")
                .withResourceId("ueayfbpcmsplb")
                .withDisableLocalAuth(true)
                .withProperties(new DataLakeAnalyticsSchemaProperties().withDataLakeStoreAccountName("wrxaomzisg"));
        model = BinaryData.fromObject(model).toObject(DataLakeAnalytics.class);
        Assertions.assertEquals("rczezkhhlt", model.computeLocation());
        Assertions.assertEquals("hqo", model.description());
        Assertions.assertEquals("ueayfbpcmsplb", model.resourceId());
        Assertions.assertEquals(true, model.disableLocalAuth());
        Assertions.assertEquals("wrxaomzisg", model.properties().dataLakeStoreAccountName());
    }
}
