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

package com.azure.resourcemanager.devhub.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.devhub.fluent.models.ArtifactGenerationProperties;
import com.azure.resourcemanager.devhub.models.DockerfileGenerationMode;
import com.azure.resourcemanager.devhub.models.GenerationLanguage;
import com.azure.resourcemanager.devhub.models.GenerationManifestType;
import com.azure.resourcemanager.devhub.models.ManifestGenerationMode;
import org.junit.jupiter.api.Assertions;

public final class ArtifactGenerationPropertiesTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        ArtifactGenerationProperties model =
            BinaryData
                .fromString(
                    "{\"generationLanguage\":\"python\",\"languageVersion\":\"wpyeicxmqciwqvh\",\"builderVersion\":\"ixuigdtopbobj\",\"port\":\"hm\",\"appName\":\"u\",\"dockerfileOutputDirectory\":\"a\",\"manifestOutputDirectory\":\"rzayv\",\"dockerfileGenerationMode\":\"enabled\",\"manifestGenerationMode\":\"enabled\",\"manifestType\":\"helm\",\"imageName\":\"iotkftutqxl\",\"namespace\":\"xlefgugnxkrx\",\"imageTag\":\"mi\"}")
                .toObject(ArtifactGenerationProperties.class);
        Assertions.assertEquals(GenerationLanguage.PYTHON, model.generationLanguage());
        Assertions.assertEquals("wpyeicxmqciwqvh", model.languageVersion());
        Assertions.assertEquals("ixuigdtopbobj", model.builderVersion());
        Assertions.assertEquals("hm", model.port());
        Assertions.assertEquals("u", model.appName());
        Assertions.assertEquals("a", model.dockerfileOutputDirectory());
        Assertions.assertEquals("rzayv", model.manifestOutputDirectory());
        Assertions.assertEquals(DockerfileGenerationMode.ENABLED, model.dockerfileGenerationMode());
        Assertions.assertEquals(ManifestGenerationMode.ENABLED, model.manifestGenerationMode());
        Assertions.assertEquals(GenerationManifestType.HELM, model.manifestType());
        Assertions.assertEquals("iotkftutqxl", model.imageName());
        Assertions.assertEquals("xlefgugnxkrx", model.namespace());
        Assertions.assertEquals("mi", model.imageTag());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        ArtifactGenerationProperties model =
            new ArtifactGenerationProperties()
                .withGenerationLanguage(GenerationLanguage.PYTHON)
                .withLanguageVersion("wpyeicxmqciwqvh")
                .withBuilderVersion("ixuigdtopbobj")
                .withPort("hm")
                .withAppName("u")
                .withDockerfileOutputDirectory("a")
                .withManifestOutputDirectory("rzayv")
                .withDockerfileGenerationMode(DockerfileGenerationMode.ENABLED)
                .withManifestGenerationMode(ManifestGenerationMode.ENABLED)
                .withManifestType(GenerationManifestType.HELM)
                .withImageName("iotkftutqxl")
                .withNamespace("xlefgugnxkrx")
                .withImageTag("mi");
        model = BinaryData.fromObject(model).toObject(ArtifactGenerationProperties.class);
        Assertions.assertEquals(GenerationLanguage.PYTHON, model.generationLanguage());
        Assertions.assertEquals("wpyeicxmqciwqvh", model.languageVersion());
        Assertions.assertEquals("ixuigdtopbobj", model.builderVersion());
        Assertions.assertEquals("hm", model.port());
        Assertions.assertEquals("u", model.appName());
        Assertions.assertEquals("a", model.dockerfileOutputDirectory());
        Assertions.assertEquals("rzayv", model.manifestOutputDirectory());
        Assertions.assertEquals(DockerfileGenerationMode.ENABLED, model.dockerfileGenerationMode());
        Assertions.assertEquals(ManifestGenerationMode.ENABLED, model.manifestGenerationMode());
        Assertions.assertEquals(GenerationManifestType.HELM, model.manifestType());
        Assertions.assertEquals("iotkftutqxl", model.imageName());
        Assertions.assertEquals("xlefgugnxkrx", model.namespace());
        Assertions.assertEquals("mi", model.imageTag());
    }
}
