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

package com.azure.resourcemanager.frontdoor.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.frontdoor.models.FrontDoorHealthProbeMethod;
import com.azure.resourcemanager.frontdoor.models.FrontDoorProtocol;
import com.azure.resourcemanager.frontdoor.models.HealthProbeEnabled;
import com.azure.resourcemanager.frontdoor.models.HealthProbeSettingsModel;
import org.junit.jupiter.api.Assertions;

public final class HealthProbeSettingsModelTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        HealthProbeSettingsModel model =
            BinaryData
                .fromString(
                    "{\"properties\":{\"resourceState\":\"Enabled\",\"path\":\"yq\",\"protocol\":\"Http\",\"intervalInSeconds\":332393883,\"healthProbeMethod\":\"HEAD\",\"enabledState\":\"Disabled\"},\"name\":\"qlkth\",\"type\":\"aqolbgycduiertg\",\"id\":\"y\"}")
                .toObject(HealthProbeSettingsModel.class);
        Assertions.assertEquals("y", model.id());
        Assertions.assertEquals("qlkth", model.name());
        Assertions.assertEquals("yq", model.path());
        Assertions.assertEquals(FrontDoorProtocol.HTTP, model.protocol());
        Assertions.assertEquals(332393883, model.intervalInSeconds());
        Assertions.assertEquals(FrontDoorHealthProbeMethod.HEAD, model.healthProbeMethod());
        Assertions.assertEquals(HealthProbeEnabled.DISABLED, model.enabledState());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        HealthProbeSettingsModel model =
            new HealthProbeSettingsModel()
                .withId("y")
                .withName("qlkth")
                .withPath("yq")
                .withProtocol(FrontDoorProtocol.HTTP)
                .withIntervalInSeconds(332393883)
                .withHealthProbeMethod(FrontDoorHealthProbeMethod.HEAD)
                .withEnabledState(HealthProbeEnabled.DISABLED);
        model = BinaryData.fromObject(model).toObject(HealthProbeSettingsModel.class);
        Assertions.assertEquals("y", model.id());
        Assertions.assertEquals("qlkth", model.name());
        Assertions.assertEquals("yq", model.path());
        Assertions.assertEquals(FrontDoorProtocol.HTTP, model.protocol());
        Assertions.assertEquals(332393883, model.intervalInSeconds());
        Assertions.assertEquals(FrontDoorHealthProbeMethod.HEAD, model.healthProbeMethod());
        Assertions.assertEquals(HealthProbeEnabled.DISABLED, model.enabledState());
    }
}
