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

package com.azure.resourcemanager.machinelearning.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.machinelearning.models.BatchRetrySettings;
import java.time.Duration;
import org.junit.jupiter.api.Assertions;

public final class BatchRetrySettingsTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        BatchRetrySettings model =
            BinaryData
                .fromString("{\"maxRetries\":80770684,\"timeout\":\"PT155H21M58S\"}")
                .toObject(BatchRetrySettings.class);
        Assertions.assertEquals(80770684, model.maxRetries());
        Assertions.assertEquals(Duration.parse("PT155H21M58S"), model.timeout());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        BatchRetrySettings model =
            new BatchRetrySettings().withMaxRetries(80770684).withTimeout(Duration.parse("PT155H21M58S"));
        model = BinaryData.fromObject(model).toObject(BatchRetrySettings.class);
        Assertions.assertEquals(80770684, model.maxRetries());
        Assertions.assertEquals(Duration.parse("PT155H21M58S"), model.timeout());
    }
}
