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

package com.azure.resourcemanager.managednetworkfabric.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.managednetworkfabric.fluent.models.CommonPostActionResponseForDeviceUpdateInner;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;

public final class CommonPostActionResponseForDeviceUpdateInnerTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        CommonPostActionResponseForDeviceUpdateInner model =
            BinaryData
                .fromString(
                    "{\"configurationState\":\"Provisioned\",\"successfulDevices\":[\"gfnzh\",\"tmjtsghp\"],\"failedDevices\":[\"cp\",\"arpzeqacdldtzm\",\"ypefcpczshnuqnda\",\"zupfkhuytuszxhm\"]}")
                .toObject(CommonPostActionResponseForDeviceUpdateInner.class);
        Assertions.assertEquals("gfnzh", model.successfulDevices().get(0));
        Assertions.assertEquals("cp", model.failedDevices().get(0));
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        CommonPostActionResponseForDeviceUpdateInner model =
            new CommonPostActionResponseForDeviceUpdateInner()
                .withSuccessfulDevices(Arrays.asList("gfnzh", "tmjtsghp"))
                .withFailedDevices(Arrays.asList("cp", "arpzeqacdldtzm", "ypefcpczshnuqnda", "zupfkhuytuszxhm"));
        model = BinaryData.fromObject(model).toObject(CommonPostActionResponseForDeviceUpdateInner.class);
        Assertions.assertEquals("gfnzh", model.successfulDevices().get(0));
        Assertions.assertEquals("cp", model.failedDevices().get(0));
    }
}
