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

package com.azure.resourcemanager.security.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.security.fluent.models.JitNetworkAccessPolicyInner;
import com.azure.resourcemanager.security.models.JitNetworkAccessPoliciesList;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;

public final class JitNetworkAccessPoliciesListTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        JitNetworkAccessPoliciesList model =
            BinaryData
                .fromString(
                    "{\"value\":[{\"properties\":{\"virtualMachines\":[],\"requests\":[],\"provisioningState\":\"bzefezr\"},\"kind\":\"czurtlei\",\"location\":\"xbkwv\",\"id\":\"gnzvdfbzdixzm\",\"name\":\"pnodawopqhe\",\"type\":\"jptmcgsbost\"},{\"properties\":{\"virtualMachines\":[],\"requests\":[],\"provisioningState\":\"ndlatutmzlbi\"},\"kind\":\"lvfhrbbp\",\"location\":\"qvcww\",\"id\":\"yurmochpprprs\",\"name\":\"mo\",\"type\":\"ayzejnhlbkpbz\"}],\"nextLink\":\"piljhahzvech\"}")
                .toObject(JitNetworkAccessPoliciesList.class);
        Assertions.assertEquals("czurtlei", model.value().get(0).kind());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        JitNetworkAccessPoliciesList model =
            new JitNetworkAccessPoliciesList()
                .withValue(
                    Arrays
                        .asList(
                            new JitNetworkAccessPolicyInner()
                                .withKind("czurtlei")
                                .withVirtualMachines(Arrays.asList())
                                .withRequests(Arrays.asList()),
                            new JitNetworkAccessPolicyInner()
                                .withKind("lvfhrbbp")
                                .withVirtualMachines(Arrays.asList())
                                .withRequests(Arrays.asList())));
        model = BinaryData.fromObject(model).toObject(JitNetworkAccessPoliciesList.class);
        Assertions.assertEquals("czurtlei", model.value().get(0).kind());
    }
}
