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

public final class CreateOrUpdateComputePolicyParametersTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        CreateOrUpdateComputePolicyParameters model =
            BinaryData
                .fromString(
                    "{\"properties\":{\"objectId\":\"895cfe29-c6e9-441e-b8ed-69a74873f9bc\",\"objectType\":\"ServicePrincipal\",\"maxDegreeOfParallelismPerJob\":1300207213,\"minPriorityPerJob\":1267023941}}")
                .toObject(CreateOrUpdateComputePolicyParameters.class);
        Assertions.assertEquals(UUID.fromString("895cfe29-c6e9-441e-b8ed-69a74873f9bc"), model.objectId());
        Assertions.assertEquals(AadObjectType.SERVICE_PRINCIPAL, model.objectType());
        Assertions.assertEquals(1300207213, model.maxDegreeOfParallelismPerJob());
        Assertions.assertEquals(1267023941, model.minPriorityPerJob());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        CreateOrUpdateComputePolicyParameters model =
            new CreateOrUpdateComputePolicyParameters()
                .withObjectId(UUID.fromString("895cfe29-c6e9-441e-b8ed-69a74873f9bc"))
                .withObjectType(AadObjectType.SERVICE_PRINCIPAL)
                .withMaxDegreeOfParallelismPerJob(1300207213)
                .withMinPriorityPerJob(1267023941);
        model = BinaryData.fromObject(model).toObject(CreateOrUpdateComputePolicyParameters.class);
        Assertions.assertEquals(UUID.fromString("895cfe29-c6e9-441e-b8ed-69a74873f9bc"), model.objectId());
        Assertions.assertEquals(AadObjectType.SERVICE_PRINCIPAL, model.objectType());
        Assertions.assertEquals(1300207213, model.maxDegreeOfParallelismPerJob());
        Assertions.assertEquals(1267023941, model.minPriorityPerJob());
    }
}
