// 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.models.AadObjectType;
import com.azure.resourcemanager.datalakeanalytics.models.UpdateComputePolicyParameters;
import java.util.UUID;
import org.junit.jupiter.api.Assertions;

public final class UpdateComputePolicyParametersTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        UpdateComputePolicyParameters model =
            BinaryData
                .fromString(
                    "{\"properties\":{\"objectId\":\"4d1642d1-159a-4bf5-b5a3-6620ebcfbd6b\",\"objectType\":\"ServicePrincipal\",\"maxDegreeOfParallelismPerJob\":106055921,\"minPriorityPerJob\":421254098}}")
                .toObject(UpdateComputePolicyParameters.class);
        Assertions.assertEquals(UUID.fromString("4d1642d1-159a-4bf5-b5a3-6620ebcfbd6b"), model.objectId());
        Assertions.assertEquals(AadObjectType.SERVICE_PRINCIPAL, model.objectType());
        Assertions.assertEquals(106055921, model.maxDegreeOfParallelismPerJob());
        Assertions.assertEquals(421254098, model.minPriorityPerJob());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        UpdateComputePolicyParameters model =
            new UpdateComputePolicyParameters()
                .withObjectId(UUID.fromString("4d1642d1-159a-4bf5-b5a3-6620ebcfbd6b"))
                .withObjectType(AadObjectType.SERVICE_PRINCIPAL)
                .withMaxDegreeOfParallelismPerJob(106055921)
                .withMinPriorityPerJob(421254098);
        model = BinaryData.fromObject(model).toObject(UpdateComputePolicyParameters.class);
        Assertions.assertEquals(UUID.fromString("4d1642d1-159a-4bf5-b5a3-6620ebcfbd6b"), model.objectId());
        Assertions.assertEquals(AadObjectType.SERVICE_PRINCIPAL, model.objectType());
        Assertions.assertEquals(106055921, model.maxDegreeOfParallelismPerJob());
        Assertions.assertEquals(421254098, model.minPriorityPerJob());
    }
}
