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

package com.azure.resourcemanager.kubernetesconfiguration.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.kubernetesconfiguration.models.KustomizationPatchDefinition;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;

public final class KustomizationPatchDefinitionTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        KustomizationPatchDefinition model =
            BinaryData
                .fromString(
                    "{\"path\":\"fhyhltrpmopjmcma\",\"dependsOn\":[\"kthfui\"],\"timeoutInSeconds\":8411741247205328781,\"syncIntervalInSeconds\":2922940373355602570,\"retryIntervalInSeconds\":4723092601162444812,\"prune\":true,\"force\":true}")
                .toObject(KustomizationPatchDefinition.class);
        Assertions.assertEquals("fhyhltrpmopjmcma", model.path());
        Assertions.assertEquals("kthfui", model.dependsOn().get(0));
        Assertions.assertEquals(8411741247205328781L, model.timeoutInSeconds());
        Assertions.assertEquals(2922940373355602570L, model.syncIntervalInSeconds());
        Assertions.assertEquals(4723092601162444812L, model.retryIntervalInSeconds());
        Assertions.assertEquals(true, model.prune());
        Assertions.assertEquals(true, model.force());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        KustomizationPatchDefinition model =
            new KustomizationPatchDefinition()
                .withPath("fhyhltrpmopjmcma")
                .withDependsOn(Arrays.asList("kthfui"))
                .withTimeoutInSeconds(8411741247205328781L)
                .withSyncIntervalInSeconds(2922940373355602570L)
                .withRetryIntervalInSeconds(4723092601162444812L)
                .withPrune(true)
                .withForce(true);
        model = BinaryData.fromObject(model).toObject(KustomizationPatchDefinition.class);
        Assertions.assertEquals("fhyhltrpmopjmcma", model.path());
        Assertions.assertEquals("kthfui", model.dependsOn().get(0));
        Assertions.assertEquals(8411741247205328781L, model.timeoutInSeconds());
        Assertions.assertEquals(2922940373355602570L, model.syncIntervalInSeconds());
        Assertions.assertEquals(4723092601162444812L, model.retryIntervalInSeconds());
        Assertions.assertEquals(true, model.prune());
        Assertions.assertEquals(true, model.force());
    }
}
