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

package com.azure.resourcemanager.delegatednetwork.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.delegatednetwork.models.ControllerDetails;
import com.azure.resourcemanager.delegatednetwork.models.OrchestratorResourceProperties;
import org.junit.jupiter.api.Assertions;

public final class OrchestratorResourcePropertiesTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        OrchestratorResourceProperties model =
            BinaryData
                .fromString(
                    "{\"resourceGuid\":\"zevdphlx\",\"provisioningState\":\"Failed\",\"orchestratorAppId\":\"hqtrgqjbpf\",\"orchestratorTenantId\":\"s\",\"clusterRootCA\":\"zgvfcjrwz\",\"apiServerEndpoint\":\"xjtfelluwfzit\",\"privateLinkResourceId\":\"peqfpjkjl\",\"controllerDetails\":{\"id\":\"fpdvhpfxxypi\"}}")
                .toObject(OrchestratorResourceProperties.class);
        Assertions.assertEquals("hqtrgqjbpf", model.orchestratorAppId());
        Assertions.assertEquals("s", model.orchestratorTenantId());
        Assertions.assertEquals("zgvfcjrwz", model.clusterRootCA());
        Assertions.assertEquals("xjtfelluwfzit", model.apiServerEndpoint());
        Assertions.assertEquals("peqfpjkjl", model.privateLinkResourceId());
        Assertions.assertEquals("fpdvhpfxxypi", model.controllerDetails().id());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        OrchestratorResourceProperties model =
            new OrchestratorResourceProperties()
                .withOrchestratorAppId("hqtrgqjbpf")
                .withOrchestratorTenantId("s")
                .withClusterRootCA("zgvfcjrwz")
                .withApiServerEndpoint("xjtfelluwfzit")
                .withPrivateLinkResourceId("peqfpjkjl")
                .withControllerDetails(new ControllerDetails().withId("fpdvhpfxxypi"));
        model = BinaryData.fromObject(model).toObject(OrchestratorResourceProperties.class);
        Assertions.assertEquals("hqtrgqjbpf", model.orchestratorAppId());
        Assertions.assertEquals("s", model.orchestratorTenantId());
        Assertions.assertEquals("zgvfcjrwz", model.clusterRootCA());
        Assertions.assertEquals("xjtfelluwfzit", model.apiServerEndpoint());
        Assertions.assertEquals("peqfpjkjl", model.privateLinkResourceId());
        Assertions.assertEquals("fpdvhpfxxypi", model.controllerDetails().id());
    }
}
