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

package com.azure.resourcemanager.appcontainers.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.appcontainers.models.ContainerAppProbeHttpGet;
import com.azure.resourcemanager.appcontainers.models.ContainerAppProbeHttpGetHttpHeadersItem;
import com.azure.resourcemanager.appcontainers.models.Scheme;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;

public final class ContainerAppProbeHttpGetTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        ContainerAppProbeHttpGet model =
            BinaryData
                .fromString(
                    "{\"host\":\"xrbuukzclew\",\"httpHeaders\":[{\"name\":\"lw\",\"value\":\"aztz\"},{\"name\":\"ofncckwyfzqwhxxb\",\"value\":\"yq\"}],\"path\":\"zfeqztppri\",\"port\":1872827948,\"scheme\":\"HTTP\"}")
                .toObject(ContainerAppProbeHttpGet.class);
        Assertions.assertEquals("xrbuukzclew", model.host());
        Assertions.assertEquals("lw", model.httpHeaders().get(0).name());
        Assertions.assertEquals("aztz", model.httpHeaders().get(0).value());
        Assertions.assertEquals("zfeqztppri", model.path());
        Assertions.assertEquals(1872827948, model.port());
        Assertions.assertEquals(Scheme.HTTP, model.scheme());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        ContainerAppProbeHttpGet model =
            new ContainerAppProbeHttpGet()
                .withHost("xrbuukzclew")
                .withHttpHeaders(
                    Arrays
                        .asList(
                            new ContainerAppProbeHttpGetHttpHeadersItem().withName("lw").withValue("aztz"),
                            new ContainerAppProbeHttpGetHttpHeadersItem().withName("ofncckwyfzqwhxxb").withValue("yq")))
                .withPath("zfeqztppri")
                .withPort(1872827948)
                .withScheme(Scheme.HTTP);
        model = BinaryData.fromObject(model).toObject(ContainerAppProbeHttpGet.class);
        Assertions.assertEquals("xrbuukzclew", model.host());
        Assertions.assertEquals("lw", model.httpHeaders().get(0).name());
        Assertions.assertEquals("aztz", model.httpHeaders().get(0).value());
        Assertions.assertEquals("zfeqztppri", model.path());
        Assertions.assertEquals(1872827948, model.port());
        Assertions.assertEquals(Scheme.HTTP, model.scheme());
    }
}
