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

package com.azure.resourcemanager.datalakeanalytics.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.datalakeanalytics.fluent.models.UpdateComputePolicyProperties;
import com.azure.resourcemanager.datalakeanalytics.models.AadObjectType;
import java.util.UUID;
import org.junit.jupiter.api.Assertions;

public final class UpdateComputePolicyPropertiesTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        UpdateComputePolicyProperties model =
            BinaryData
                .fromString(
                    "{\"objectId\":\"57ce7827-18d5-45bd-95ad-b54e5892436f\",\"objectType\":\"Group\",\"maxDegreeOfParallelismPerJob\":112236140,\"minPriorityPerJob\":743526122}")
                .toObject(UpdateComputePolicyProperties.class);
        Assertions.assertEquals(UUID.fromString("57ce7827-18d5-45bd-95ad-b54e5892436f"), model.objectId());
        Assertions.assertEquals(AadObjectType.GROUP, model.objectType());
        Assertions.assertEquals(112236140, model.maxDegreeOfParallelismPerJob());
        Assertions.assertEquals(743526122, model.minPriorityPerJob());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        UpdateComputePolicyProperties model =
            new UpdateComputePolicyProperties()
                .withObjectId(UUID.fromString("57ce7827-18d5-45bd-95ad-b54e5892436f"))
                .withObjectType(AadObjectType.GROUP)
                .withMaxDegreeOfParallelismPerJob(112236140)
                .withMinPriorityPerJob(743526122);
        model = BinaryData.fromObject(model).toObject(UpdateComputePolicyProperties.class);
        Assertions.assertEquals(UUID.fromString("57ce7827-18d5-45bd-95ad-b54e5892436f"), model.objectId());
        Assertions.assertEquals(AadObjectType.GROUP, model.objectType());
        Assertions.assertEquals(112236140, model.maxDegreeOfParallelismPerJob());
        Assertions.assertEquals(743526122, model.minPriorityPerJob());
    }
}
