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

package com.azure.resourcemanager.containerservicefleet.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.containerservicefleet.models.UpdateRunStrategy;
import com.azure.resourcemanager.containerservicefleet.models.UpdateStage;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;

public final class UpdateRunStrategyTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        UpdateRunStrategy model =
            BinaryData
                .fromString(
                    "{\"stages\":[{\"name\":\"dfvzwdzuhty\",\"groups\":[],\"afterStageWaitInSeconds\":396497881}]}")
                .toObject(UpdateRunStrategy.class);
        Assertions.assertEquals("dfvzwdzuhty", model.stages().get(0).name());
        Assertions.assertEquals(396497881, model.stages().get(0).afterStageWaitInSeconds());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        UpdateRunStrategy model =
            new UpdateRunStrategy()
                .withStages(
                    Arrays
                        .asList(
                            new UpdateStage()
                                .withName("dfvzwdzuhty")
                                .withGroups(Arrays.asList())
                                .withAfterStageWaitInSeconds(396497881)));
        model = BinaryData.fromObject(model).toObject(UpdateRunStrategy.class);
        Assertions.assertEquals("dfvzwdzuhty", model.stages().get(0).name());
        Assertions.assertEquals(396497881, model.stages().get(0).afterStageWaitInSeconds());
    }
}
