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

package com.azure.resourcemanager.synapse.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.synapse.fluent.models.SsisObjectMetadataListResponseInner;
import com.azure.resourcemanager.synapse.models.SsisObjectMetadata;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;

public final class SsisObjectMetadataListResponseInnerTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        SsisObjectMetadataListResponseInner model =
            BinaryData
                .fromString(
                    "{\"value\":[{\"type\":\"SsisObjectMetadata\",\"id\":4290491258630313761,\"name\":\"qalarvlagunbtg\",\"description\":\"bwln\"},{\"type\":\"SsisObjectMetadata\",\"id\":6785534445230421786,\"name\":\"e\",\"description\":\"dzqavbpdqmjxlyyz\"},{\"type\":\"SsisObjectMetadata\",\"id\":8314033620834020740,\"name\":\"wtlmjjyuo\",\"description\":\"tob\"}],\"nextLink\":\"kjeytunl\"}")
                .toObject(SsisObjectMetadataListResponseInner.class);
        Assertions.assertEquals(4290491258630313761L, model.value().get(0).id());
        Assertions.assertEquals("qalarvlagunbtg", model.value().get(0).name());
        Assertions.assertEquals("bwln", model.value().get(0).description());
        Assertions.assertEquals("kjeytunl", model.nextLink());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        SsisObjectMetadataListResponseInner model =
            new SsisObjectMetadataListResponseInner()
                .withValue(
                    Arrays
                        .asList(
                            new SsisObjectMetadata()
                                .withId(4290491258630313761L)
                                .withName("qalarvlagunbtg")
                                .withDescription("bwln"),
                            new SsisObjectMetadata()
                                .withId(6785534445230421786L)
                                .withName("e")
                                .withDescription("dzqavbpdqmjxlyyz"),
                            new SsisObjectMetadata()
                                .withId(8314033620834020740L)
                                .withName("wtlmjjyuo")
                                .withDescription("tob")))
                .withNextLink("kjeytunl");
        model = BinaryData.fromObject(model).toObject(SsisObjectMetadataListResponseInner.class);
        Assertions.assertEquals(4290491258630313761L, model.value().get(0).id());
        Assertions.assertEquals("qalarvlagunbtg", model.value().get(0).name());
        Assertions.assertEquals("bwln", model.value().get(0).description());
        Assertions.assertEquals("kjeytunl", model.nextLink());
    }
}
