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

package com.azure.resourcemanager.iotfirmwaredefense.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.iotfirmwaredefense.fluent.models.FirmwareProperties;
import com.azure.resourcemanager.iotfirmwaredefense.models.Status;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;

public final class FirmwarePropertiesTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        FirmwareProperties model =
            BinaryData
                .fromString(
                    "{\"fileName\":\"jgrtfwvukxga\",\"vendor\":\"ccsnhsjc\",\"model\":\"ejhkry\",\"version\":\"napczwlokjy\",\"description\":\"kkvnipjox\",\"fileSize\":6610645791355850354,\"status\":\"Extracting\",\"statusMessages\":[\"dataspodmail\",\"dataydehoj\",\"datayahux\",\"datanpmqnjaqwixjspro\"],\"provisioningState\":\"Failed\"}")
                .toObject(FirmwareProperties.class);
        Assertions.assertEquals("jgrtfwvukxga", model.fileName());
        Assertions.assertEquals("ccsnhsjc", model.vendor());
        Assertions.assertEquals("ejhkry", model.model());
        Assertions.assertEquals("napczwlokjy", model.version());
        Assertions.assertEquals("kkvnipjox", model.description());
        Assertions.assertEquals(6610645791355850354L, model.fileSize());
        Assertions.assertEquals(Status.EXTRACTING, model.status());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        FirmwareProperties model =
            new FirmwareProperties()
                .withFileName("jgrtfwvukxga")
                .withVendor("ccsnhsjc")
                .withModel("ejhkry")
                .withVersion("napczwlokjy")
                .withDescription("kkvnipjox")
                .withFileSize(6610645791355850354L)
                .withStatus(Status.EXTRACTING)
                .withStatusMessages(Arrays.asList("dataspodmail", "dataydehoj", "datayahux", "datanpmqnjaqwixjspro"));
        model = BinaryData.fromObject(model).toObject(FirmwareProperties.class);
        Assertions.assertEquals("jgrtfwvukxga", model.fileName());
        Assertions.assertEquals("ccsnhsjc", model.vendor());
        Assertions.assertEquals("ejhkry", model.model());
        Assertions.assertEquals("napczwlokjy", model.version());
        Assertions.assertEquals("kkvnipjox", model.description());
        Assertions.assertEquals(6610645791355850354L, model.fileSize());
        Assertions.assertEquals(Status.EXTRACTING, model.status());
    }
}
