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

public final class KustomizationDefinitionTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        KustomizationDefinition model =
            BinaryData
                .fromString(
                    "{\"name\":\"wjdk\",\"path\":\"soodqxhcrmnoh\",\"dependsOn\":[\"kwh\",\"soifiyipjxsqw\"],\"timeoutInSeconds\":2704236244531071102,\"syncIntervalInSeconds\":6416527667848013602,\"retryIntervalInSeconds\":6117195169735305207,\"prune\":false,\"force\":false}")
                .toObject(KustomizationDefinition.class);
        Assertions.assertEquals("soodqxhcrmnoh", model.path());
        Assertions.assertEquals("kwh", model.dependsOn().get(0));
        Assertions.assertEquals(2704236244531071102L, model.timeoutInSeconds());
        Assertions.assertEquals(6416527667848013602L, model.syncIntervalInSeconds());
        Assertions.assertEquals(6117195169735305207L, model.retryIntervalInSeconds());
        Assertions.assertEquals(false, model.prune());
        Assertions.assertEquals(false, model.force());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        KustomizationDefinition model =
            new KustomizationDefinition()
                .withPath("soodqxhcrmnoh")
                .withDependsOn(Arrays.asList("kwh", "soifiyipjxsqw"))
                .withTimeoutInSeconds(2704236244531071102L)
                .withSyncIntervalInSeconds(6416527667848013602L)
                .withRetryIntervalInSeconds(6117195169735305207L)
                .withPrune(false)
                .withForce(false);
        model = BinaryData.fromObject(model).toObject(KustomizationDefinition.class);
        Assertions.assertEquals("soodqxhcrmnoh", model.path());
        Assertions.assertEquals("kwh", model.dependsOn().get(0));
        Assertions.assertEquals(2704236244531071102L, model.timeoutInSeconds());
        Assertions.assertEquals(6416527667848013602L, model.syncIntervalInSeconds());
        Assertions.assertEquals(6117195169735305207L, model.retryIntervalInSeconds());
        Assertions.assertEquals(false, model.prune());
        Assertions.assertEquals(false, model.force());
    }
}
