// 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.UpdateComputePolicyWithAccountParameters;
import java.util.UUID;
import org.junit.jupiter.api.Assertions;

public final class UpdateComputePolicyWithAccountParametersTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        UpdateComputePolicyWithAccountParameters model =
            BinaryData
                .fromString(
                    "{\"name\":\"jf\",\"properties\":{\"objectId\":\"55cad992-f814-4a9d-9ac7-0effd1523924\",\"objectType\":\"ServicePrincipal\",\"maxDegreeOfParallelismPerJob\":910788688,\"minPriorityPerJob\":1688727412}}")
                .toObject(UpdateComputePolicyWithAccountParameters.class);
        Assertions.assertEquals("jf", model.name());
        Assertions.assertEquals(UUID.fromString("55cad992-f814-4a9d-9ac7-0effd1523924"), model.objectId());
        Assertions.assertEquals(AadObjectType.SERVICE_PRINCIPAL, model.objectType());
        Assertions.assertEquals(910788688, model.maxDegreeOfParallelismPerJob());
        Assertions.assertEquals(1688727412, model.minPriorityPerJob());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        UpdateComputePolicyWithAccountParameters model =
            new UpdateComputePolicyWithAccountParameters()
                .withName("jf")
                .withObjectId(UUID.fromString("55cad992-f814-4a9d-9ac7-0effd1523924"))
                .withObjectType(AadObjectType.SERVICE_PRINCIPAL)
                .withMaxDegreeOfParallelismPerJob(910788688)
                .withMinPriorityPerJob(1688727412);
        model = BinaryData.fromObject(model).toObject(UpdateComputePolicyWithAccountParameters.class);
        Assertions.assertEquals("jf", model.name());
        Assertions.assertEquals(UUID.fromString("55cad992-f814-4a9d-9ac7-0effd1523924"), model.objectId());
        Assertions.assertEquals(AadObjectType.SERVICE_PRINCIPAL, model.objectType());
        Assertions.assertEquals(910788688, model.maxDegreeOfParallelismPerJob());
        Assertions.assertEquals(1688727412, model.minPriorityPerJob());
    }
}
