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

package com.azure.resourcemanager.workloads.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.workloads.models.PrometheusHaClusterProviderInstanceProperties;
import com.azure.resourcemanager.workloads.models.SslPreference;
import org.junit.jupiter.api.Assertions;

public final class PrometheusHaClusterProviderInstancePropertiesTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        PrometheusHaClusterProviderInstanceProperties model =
            BinaryData
                .fromString(
                    "{\"providerType\":\"PrometheusHaCluster\",\"prometheusUrl\":\"x\",\"hostname\":\"czheyd\",\"sid\":\"dshmkxmaehvbbx\",\"clusterName\":\"iplt\",\"sslPreference\":\"ServerCertificate\",\"sslCertificateUri\":\"baxk\"}")
                .toObject(PrometheusHaClusterProviderInstanceProperties.class);
        Assertions.assertEquals("x", model.prometheusUrl());
        Assertions.assertEquals("czheyd", model.hostname());
        Assertions.assertEquals("dshmkxmaehvbbx", model.sid());
        Assertions.assertEquals("iplt", model.clusterName());
        Assertions.assertEquals(SslPreference.SERVER_CERTIFICATE, model.sslPreference());
        Assertions.assertEquals("baxk", model.sslCertificateUri());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        PrometheusHaClusterProviderInstanceProperties model =
            new PrometheusHaClusterProviderInstanceProperties()
                .withPrometheusUrl("x")
                .withHostname("czheyd")
                .withSid("dshmkxmaehvbbx")
                .withClusterName("iplt")
                .withSslPreference(SslPreference.SERVER_CERTIFICATE)
                .withSslCertificateUri("baxk");
        model = BinaryData.fromObject(model).toObject(PrometheusHaClusterProviderInstanceProperties.class);
        Assertions.assertEquals("x", model.prometheusUrl());
        Assertions.assertEquals("czheyd", model.hostname());
        Assertions.assertEquals("dshmkxmaehvbbx", model.sid());
        Assertions.assertEquals("iplt", model.clusterName());
        Assertions.assertEquals(SslPreference.SERVER_CERTIFICATE, model.sslPreference());
        Assertions.assertEquals("baxk", model.sslCertificateUri());
    }
}
