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

package com.azure.resourcemanager.mysqlflexibleserver.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.mysqlflexibleserver.models.EnableStatusEnum;
import com.azure.resourcemanager.mysqlflexibleserver.models.ServerRestartParameter;
import org.junit.jupiter.api.Assertions;

public final class ServerRestartParameterTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        ServerRestartParameter model =
            BinaryData
                .fromString("{\"restartWithFailover\":\"Enabled\",\"maxFailoverSeconds\":1752385169}")
                .toObject(ServerRestartParameter.class);
        Assertions.assertEquals(EnableStatusEnum.ENABLED, model.restartWithFailover());
        Assertions.assertEquals(1752385169, model.maxFailoverSeconds());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        ServerRestartParameter model =
            new ServerRestartParameter()
                .withRestartWithFailover(EnableStatusEnum.ENABLED)
                .withMaxFailoverSeconds(1752385169);
        model = BinaryData.fromObject(model).toObject(ServerRestartParameter.class);
        Assertions.assertEquals(EnableStatusEnum.ENABLED, model.restartWithFailover());
        Assertions.assertEquals(1752385169, model.maxFailoverSeconds());
    }
}
