// 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.NeighborGroupProperties;
import com.azure.resourcemanager.managednetworkfabric.models.NeighborGroupDestination;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;

public final class NeighborGroupPropertiesTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        NeighborGroupProperties model =
            BinaryData
                .fromString(
                    "{\"networkTapIds\":[\"qqw\",\"tqsmoxsa\",\"uxejgwecywnfyszz\",\"czs\"],\"networkTapRuleIds\":[\"bdnd\"],\"provisioningState\":\"Deleting\",\"destination\":{\"ipv4Addresses\":[\"yvrmkjm\",\"it\",\"chwudlxee\"],\"ipv6Addresses\":[\"pmnoejhqlf\",\"sibz\"]},\"annotation\":\"rfgxkyd\"}")
                .toObject(NeighborGroupProperties.class);
        Assertions.assertEquals("rfgxkyd", model.annotation());
        Assertions.assertEquals("yvrmkjm", model.destination().ipv4Addresses().get(0));
        Assertions.assertEquals("pmnoejhqlf", model.destination().ipv6Addresses().get(0));
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        NeighborGroupProperties model =
            new NeighborGroupProperties()
                .withAnnotation("rfgxkyd")
                .withDestination(
                    new NeighborGroupDestination()
                        .withIpv4Addresses(Arrays.asList("yvrmkjm", "it", "chwudlxee"))
                        .withIpv6Addresses(Arrays.asList("pmnoejhqlf", "sibz")));
        model = BinaryData.fromObject(model).toObject(NeighborGroupProperties.class);
        Assertions.assertEquals("rfgxkyd", model.annotation());
        Assertions.assertEquals("yvrmkjm", model.destination().ipv4Addresses().get(0));
        Assertions.assertEquals("pmnoejhqlf", model.destination().ipv6Addresses().get(0));
    }
}
