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

package com.azure.resourcemanager.networkcloud.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.networkcloud.models.AdvertiseToFabric;
import com.azure.resourcemanager.networkcloud.models.BgpAdvertisement;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;

public final class BgpAdvertisementTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        BgpAdvertisement model =
            BinaryData
                .fromString(
                    "{\"advertiseToFabric\":\"True\",\"communities\":[\"auvfbtkuwhhmhyk\"],\"ipAddressPools\":[\"oxafn\",\"dlpichkoymkcdyhb\",\"kkpwdreqnovvq\"],\"peers\":[\"ljxywsu\",\"syrsndsytgadgvra\"]}")
                .toObject(BgpAdvertisement.class);
        Assertions.assertEquals(AdvertiseToFabric.TRUE, model.advertiseToFabric());
        Assertions.assertEquals("auvfbtkuwhhmhyk", model.communities().get(0));
        Assertions.assertEquals("oxafn", model.ipAddressPools().get(0));
        Assertions.assertEquals("ljxywsu", model.peers().get(0));
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        BgpAdvertisement model =
            new BgpAdvertisement()
                .withAdvertiseToFabric(AdvertiseToFabric.TRUE)
                .withCommunities(Arrays.asList("auvfbtkuwhhmhyk"))
                .withIpAddressPools(Arrays.asList("oxafn", "dlpichkoymkcdyhb", "kkpwdreqnovvq"))
                .withPeers(Arrays.asList("ljxywsu", "syrsndsytgadgvra"));
        model = BinaryData.fromObject(model).toObject(BgpAdvertisement.class);
        Assertions.assertEquals(AdvertiseToFabric.TRUE, model.advertiseToFabric());
        Assertions.assertEquals("auvfbtkuwhhmhyk", model.communities().get(0));
        Assertions.assertEquals("oxafn", model.ipAddressPools().get(0));
        Assertions.assertEquals("ljxywsu", model.peers().get(0));
    }
}
