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

package com.azure.resourcemanager.newrelicobservability.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.newrelicobservability.fluent.models.VMInfoInner;
import com.azure.resourcemanager.newrelicobservability.models.VMHostsListResponse;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;

public final class VMHostsListResponseTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        VMHostsListResponse model =
            BinaryData
                .fromString(
                    "{\"value\":[{\"vmId\":\"ounqecano\",\"agentVersion\":\"upfh\",\"agentStatus\":\"ltrpmopj\"}],\"nextLink\":\"matuok\"}")
                .toObject(VMHostsListResponse.class);
        Assertions.assertEquals("ounqecano", model.value().get(0).vmId());
        Assertions.assertEquals("upfh", model.value().get(0).agentVersion());
        Assertions.assertEquals("ltrpmopj", model.value().get(0).agentStatus());
        Assertions.assertEquals("matuok", model.nextLink());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        VMHostsListResponse model =
            new VMHostsListResponse()
                .withValue(
                    Arrays
                        .asList(
                            new VMInfoInner()
                                .withVmId("ounqecano")
                                .withAgentVersion("upfh")
                                .withAgentStatus("ltrpmopj")))
                .withNextLink("matuok");
        model = BinaryData.fromObject(model).toObject(VMHostsListResponse.class);
        Assertions.assertEquals("ounqecano", model.value().get(0).vmId());
        Assertions.assertEquals("upfh", model.value().get(0).agentVersion());
        Assertions.assertEquals("ltrpmopj", model.value().get(0).agentStatus());
        Assertions.assertEquals("matuok", model.nextLink());
    }
}
