// 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.CustomModelJobOutput;
import com.azure.resourcemanager.machinelearning.models.OutputDeliveryMode;
import org.junit.jupiter.api.Assertions;

public final class CustomModelJobOutputTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        CustomModelJobOutput model =
            BinaryData
                .fromString(
                    "{\"jobOutputType\":\"custom_model\",\"mode\":\"ReadWriteMount\",\"uri\":\"tjknsxfwushcdp\",\"description\":\"pn\"}")
                .toObject(CustomModelJobOutput.class);
        Assertions.assertEquals("pn", model.description());
        Assertions.assertEquals(OutputDeliveryMode.READ_WRITE_MOUNT, model.mode());
        Assertions.assertEquals("tjknsxfwushcdp", model.uri());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        CustomModelJobOutput model =
            new CustomModelJobOutput()
                .withDescription("pn")
                .withMode(OutputDeliveryMode.READ_WRITE_MOUNT)
                .withUri("tjknsxfwushcdp");
        model = BinaryData.fromObject(model).toObject(CustomModelJobOutput.class);
        Assertions.assertEquals("pn", model.description());
        Assertions.assertEquals(OutputDeliveryMode.READ_WRITE_MOUNT, model.mode());
        Assertions.assertEquals("tjknsxfwushcdp", model.uri());
    }
}
