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

package com.azure.resourcemanager.servicefabric.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.servicefabric.models.ArmServiceTypeHealthPolicy;
import org.junit.jupiter.api.Assertions;

public final class ArmServiceTypeHealthPolicyTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        ArmServiceTypeHealthPolicy model =
            BinaryData
                .fromString(
                    "{\"maxPercentUnhealthyServices\":1143509001,\"maxPercentUnhealthyPartitionsPerService\":1248197676,\"maxPercentUnhealthyReplicasPerPartition\":939698337}")
                .toObject(ArmServiceTypeHealthPolicy.class);
        Assertions.assertEquals(1143509001, model.maxPercentUnhealthyServices());
        Assertions.assertEquals(1248197676, model.maxPercentUnhealthyPartitionsPerService());
        Assertions.assertEquals(939698337, model.maxPercentUnhealthyReplicasPerPartition());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        ArmServiceTypeHealthPolicy model =
            new ArmServiceTypeHealthPolicy()
                .withMaxPercentUnhealthyServices(1143509001)
                .withMaxPercentUnhealthyPartitionsPerService(1248197676)
                .withMaxPercentUnhealthyReplicasPerPartition(939698337);
        model = BinaryData.fromObject(model).toObject(ArmServiceTypeHealthPolicy.class);
        Assertions.assertEquals(1143509001, model.maxPercentUnhealthyServices());
        Assertions.assertEquals(1248197676, model.maxPercentUnhealthyPartitionsPerService());
        Assertions.assertEquals(939698337, model.maxPercentUnhealthyReplicasPerPartition());
    }
}
