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

package com.azure.resourcemanager.avs.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkDnsServiceProperties;
import com.azure.resourcemanager.avs.models.DnsServiceLogLevelEnum;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;

public final class WorkloadNetworkDnsServicePropertiesTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        WorkloadNetworkDnsServiceProperties model =
            BinaryData
                .fromString(
                    "{\"displayName\":\"kpzksmondjmq\",\"dnsServiceIp\":\"vypomgkopkwho\",\"defaultDnsZone\":\"pajqgxysm\",\"fqdnZones\":[\"bq\",\"qvmkcxo\"],\"logLevel\":\"FATAL\",\"status\":\"FAILURE\",\"provisioningState\":\"Succeeded\",\"revision\":6359402383631764014}")
                .toObject(WorkloadNetworkDnsServiceProperties.class);
        Assertions.assertEquals("kpzksmondjmq", model.displayName());
        Assertions.assertEquals("vypomgkopkwho", model.dnsServiceIp());
        Assertions.assertEquals("pajqgxysm", model.defaultDnsZone());
        Assertions.assertEquals("bq", model.fqdnZones().get(0));
        Assertions.assertEquals(DnsServiceLogLevelEnum.FATAL, model.logLevel());
        Assertions.assertEquals(6359402383631764014L, model.revision());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        WorkloadNetworkDnsServiceProperties model =
            new WorkloadNetworkDnsServiceProperties()
                .withDisplayName("kpzksmondjmq")
                .withDnsServiceIp("vypomgkopkwho")
                .withDefaultDnsZone("pajqgxysm")
                .withFqdnZones(Arrays.asList("bq", "qvmkcxo"))
                .withLogLevel(DnsServiceLogLevelEnum.FATAL)
                .withRevision(6359402383631764014L);
        model = BinaryData.fromObject(model).toObject(WorkloadNetworkDnsServiceProperties.class);
        Assertions.assertEquals("kpzksmondjmq", model.displayName());
        Assertions.assertEquals("vypomgkopkwho", model.dnsServiceIp());
        Assertions.assertEquals("pajqgxysm", model.defaultDnsZone());
        Assertions.assertEquals("bq", model.fqdnZones().get(0));
        Assertions.assertEquals(DnsServiceLogLevelEnum.FATAL, model.logLevel());
        Assertions.assertEquals(6359402383631764014L, model.revision());
    }
}
