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

package com.azure.resourcemanager.hybridcontainerservice.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.hybridcontainerservice.models.AgentPoolProvisioningStatus;
import com.azure.resourcemanager.hybridcontainerservice.models.AgentPoolProvisioningStatusStatus;
import com.azure.resourcemanager.hybridcontainerservice.models.AgentPoolProvisioningStatusStatusProvisioningStatus;
import org.junit.jupiter.api.Assertions;

public final class AgentPoolProvisioningStatusTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        AgentPoolProvisioningStatus model =
            BinaryData
                .fromString(
                    "{\"provisioningState\":\"Canceled\",\"status\":{\"errorMessage\":\"ttouwaboekqvkel\",\"provisioningStatus\":{\"operationId\":\"bxwyjsflhhcaa\",\"phase\":\"jixisxyawjoyaqcs\",\"status\":\"jpkiidzyexznelix\"},\"readyReplicas\":705550222,\"replicas\":2120108327}}")
                .toObject(AgentPoolProvisioningStatus.class);
        Assertions.assertEquals("ttouwaboekqvkel", model.status().errorMessage());
        Assertions.assertEquals("bxwyjsflhhcaa", model.status().provisioningStatus().operationId());
        Assertions.assertEquals("jixisxyawjoyaqcs", model.status().provisioningStatus().phase());
        Assertions.assertEquals("jpkiidzyexznelix", model.status().provisioningStatus().status());
        Assertions.assertEquals(705550222, model.status().readyReplicas());
        Assertions.assertEquals(2120108327, model.status().replicas());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        AgentPoolProvisioningStatus model =
            new AgentPoolProvisioningStatus()
                .withStatus(
                    new AgentPoolProvisioningStatusStatus()
                        .withErrorMessage("ttouwaboekqvkel")
                        .withProvisioningStatus(
                            new AgentPoolProvisioningStatusStatusProvisioningStatus()
                                .withOperationId("bxwyjsflhhcaa")
                                .withPhase("jixisxyawjoyaqcs")
                                .withStatus("jpkiidzyexznelix"))
                        .withReadyReplicas(705550222)
                        .withReplicas(2120108327));
        model = BinaryData.fromObject(model).toObject(AgentPoolProvisioningStatus.class);
        Assertions.assertEquals("ttouwaboekqvkel", model.status().errorMessage());
        Assertions.assertEquals("bxwyjsflhhcaa", model.status().provisioningStatus().operationId());
        Assertions.assertEquals("jixisxyawjoyaqcs", model.status().provisioningStatus().phase());
        Assertions.assertEquals("jpkiidzyexznelix", model.status().provisioningStatus().status());
        Assertions.assertEquals(705550222, model.status().readyReplicas());
        Assertions.assertEquals(2120108327, model.status().replicas());
    }
}
