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

package com.azure.resourcemanager.paloaltonetworks.ngfw.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.paloaltonetworks.ngfw.models.SourceAddr;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;

public final class SourceAddrTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        SourceAddr model =
            BinaryData
                .fromString(
                    "{\"cidrs\":[\"ugicjooxdjebw\",\"ucww\",\"vo\"],\"countries\":[\"meue\",\"ivyhzceuojgjrwju\"],\"feeds\":[\"twm\",\"dytdxwitx\"],\"prefixLists\":[\"awgqwgxhni\",\"kxfbkpycgklwndn\"]}")
                .toObject(SourceAddr.class);
        Assertions.assertEquals("ugicjooxdjebw", model.cidrs().get(0));
        Assertions.assertEquals("meue", model.countries().get(0));
        Assertions.assertEquals("twm", model.feeds().get(0));
        Assertions.assertEquals("awgqwgxhni", model.prefixLists().get(0));
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        SourceAddr model =
            new SourceAddr()
                .withCidrs(Arrays.asList("ugicjooxdjebw", "ucww", "vo"))
                .withCountries(Arrays.asList("meue", "ivyhzceuojgjrwju"))
                .withFeeds(Arrays.asList("twm", "dytdxwitx"))
                .withPrefixLists(Arrays.asList("awgqwgxhni", "kxfbkpycgklwndn"));
        model = BinaryData.fromObject(model).toObject(SourceAddr.class);
        Assertions.assertEquals("ugicjooxdjebw", model.cidrs().get(0));
        Assertions.assertEquals("meue", model.countries().get(0));
        Assertions.assertEquals("twm", model.feeds().get(0));
        Assertions.assertEquals("awgqwgxhni", model.prefixLists().get(0));
    }
}
