// 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.ImageTemplateWindowsUpdateCustomizer;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;

public final class ImageTemplateWindowsUpdateCustomizerTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        ImageTemplateWindowsUpdateCustomizer model =
            BinaryData
                .fromString(
                    "{\"type\":\"WindowsUpdate\",\"searchCriteria\":\"dpuozmyz\",\"filters\":[\"gf\",\"axbezyiuo\",\"ktwh\"],\"updateLimit\":291798162,\"name\":\"zywqsmbsu\"}")
                .toObject(ImageTemplateWindowsUpdateCustomizer.class);
        Assertions.assertEquals("zywqsmbsu", model.name());
        Assertions.assertEquals("dpuozmyz", model.searchCriteria());
        Assertions.assertEquals("gf", model.filters().get(0));
        Assertions.assertEquals(291798162, model.updateLimit());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        ImageTemplateWindowsUpdateCustomizer model =
            new ImageTemplateWindowsUpdateCustomizer()
                .withName("zywqsmbsu")
                .withSearchCriteria("dpuozmyz")
                .withFilters(Arrays.asList("gf", "axbezyiuo", "ktwh"))
                .withUpdateLimit(291798162);
        model = BinaryData.fromObject(model).toObject(ImageTemplateWindowsUpdateCustomizer.class);
        Assertions.assertEquals("zywqsmbsu", model.name());
        Assertions.assertEquals("dpuozmyz", model.searchCriteria());
        Assertions.assertEquals("gf", model.filters().get(0));
        Assertions.assertEquals(291798162, model.updateLimit());
    }
}
