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

package com.azure.resourcemanager.imagebuilder.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.imagebuilder.models.ImageTemplateRestartCustomizer;
import org.junit.jupiter.api.Assertions;

public final class ImageTemplateRestartCustomizerTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        ImageTemplateRestartCustomizer model =
            BinaryData
                .fromString(
                    "{\"type\":\"WindowsRestart\",\"restartCommand\":\"ltrpmopj\",\"restartCheckCommand\":\"matuok\",\"restartTimeout\":\"fu\",\"name\":\"aodsfcpkv\"}")
                .toObject(ImageTemplateRestartCustomizer.class);
        Assertions.assertEquals("aodsfcpkv", model.name());
        Assertions.assertEquals("ltrpmopj", model.restartCommand());
        Assertions.assertEquals("matuok", model.restartCheckCommand());
        Assertions.assertEquals("fu", model.restartTimeout());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        ImageTemplateRestartCustomizer model =
            new ImageTemplateRestartCustomizer()
                .withName("aodsfcpkv")
                .withRestartCommand("ltrpmopj")
                .withRestartCheckCommand("matuok")
                .withRestartTimeout("fu");
        model = BinaryData.fromObject(model).toObject(ImageTemplateRestartCustomizer.class);
        Assertions.assertEquals("aodsfcpkv", model.name());
        Assertions.assertEquals("ltrpmopj", model.restartCommand());
        Assertions.assertEquals("matuok", model.restartCheckCommand());
        Assertions.assertEquals("fu", model.restartTimeout());
    }
}
