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

public final class CreateComputePolicyWithAccountParametersTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        CreateComputePolicyWithAccountParameters model =
            BinaryData
                .fromString(
                    "{\"name\":\"v\",\"properties\":{\"objectId\":\"39849be9-6629-4558-9b69-5b6eadb884a8\",\"objectType\":\"User\",\"maxDegreeOfParallelismPerJob\":928331689,\"minPriorityPerJob\":2070892597}}")
                .toObject(CreateComputePolicyWithAccountParameters.class);
        Assertions.assertEquals("v", model.name());
        Assertions.assertEquals(UUID.fromString("39849be9-6629-4558-9b69-5b6eadb884a8"), model.objectId());
        Assertions.assertEquals(AadObjectType.USER, model.objectType());
        Assertions.assertEquals(928331689, model.maxDegreeOfParallelismPerJob());
        Assertions.assertEquals(2070892597, model.minPriorityPerJob());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        CreateComputePolicyWithAccountParameters model =
            new CreateComputePolicyWithAccountParameters()
                .withName("v")
                .withObjectId(UUID.fromString("39849be9-6629-4558-9b69-5b6eadb884a8"))
                .withObjectType(AadObjectType.USER)
                .withMaxDegreeOfParallelismPerJob(928331689)
                .withMinPriorityPerJob(2070892597);
        model = BinaryData.fromObject(model).toObject(CreateComputePolicyWithAccountParameters.class);
        Assertions.assertEquals("v", model.name());
        Assertions.assertEquals(UUID.fromString("39849be9-6629-4558-9b69-5b6eadb884a8"), model.objectId());
        Assertions.assertEquals(AadObjectType.USER, model.objectType());
        Assertions.assertEquals(928331689, model.maxDegreeOfParallelismPerJob());
        Assertions.assertEquals(2070892597, model.minPriorityPerJob());
    }
}
