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

package com.azure.resourcemanager.peering.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.peering.fluent.models.PeeringReceivedRouteInner;
import com.azure.resourcemanager.peering.models.PeeringReceivedRouteListResult;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;

public final class PeeringReceivedRouteListResultTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        PeeringReceivedRouteListResult model =
            BinaryData
                .fromString(
                    "{\"value\":[{\"prefix\":\"b\",\"nextHop\":\"cuh\",\"asPath\":\"tcty\",\"originAsValidationState\":\"klbb\",\"rpkiValidationState\":\"plwzbhvgyugu\",\"trustAnchor\":\"vmkfssxqu\",\"receivedTimestamp\":\"fpl\"},{\"prefix\":\"gsxnkjzkdeslpv\",\"nextHop\":\"pwiyig\",\"asPath\":\"pkdwzbai\",\"originAsValidationState\":\"bbaumnyquped\",\"rpkiValidationState\":\"jn\",\"trustAnchor\":\"ckhsmtxpsieb\",\"receivedTimestamp\":\"hvpesapskrdqm\"},{\"prefix\":\"jdhtldwkyzxu\",\"nextHop\":\"kn\",\"asPath\":\"scwsv\",\"originAsValidationState\":\"otogtwrupqs\",\"rpkiValidationState\":\"nmic\",\"trustAnchor\":\"vce\",\"receivedTimestamp\":\"eil\"}],\"nextLink\":\"notyfjfcnjbkcn\"}")
                .toObject(PeeringReceivedRouteListResult.class);
        Assertions.assertEquals("notyfjfcnjbkcn", model.nextLink());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        PeeringReceivedRouteListResult model =
            new PeeringReceivedRouteListResult()
                .withValue(
                    Arrays
                        .asList(
                            new PeeringReceivedRouteInner(),
                            new PeeringReceivedRouteInner(),
                            new PeeringReceivedRouteInner()))
                .withNextLink("notyfjfcnjbkcn");
        model = BinaryData.fromObject(model).toObject(PeeringReceivedRouteListResult.class);
        Assertions.assertEquals("notyfjfcnjbkcn", model.nextLink());
    }
}
