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

package com.azure.resourcemanager.recoveryservicesbackup.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.recoveryservicesbackup.models.ClientDiscoveryForLogSpecification;
import com.azure.resourcemanager.recoveryservicesbackup.models.ClientDiscoveryForServiceSpecification;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;

public final class ClientDiscoveryForServiceSpecificationTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        ClientDiscoveryForServiceSpecification model =
            BinaryData
                .fromString(
                    "{\"logSpecifications\":[{\"name\":\"cyshurzafbljjgp\",\"displayName\":\"oq\",\"blobDuration\":\"mkljavb\"}]}")
                .toObject(ClientDiscoveryForServiceSpecification.class);
        Assertions.assertEquals("cyshurzafbljjgp", model.logSpecifications().get(0).name());
        Assertions.assertEquals("oq", model.logSpecifications().get(0).displayName());
        Assertions.assertEquals("mkljavb", model.logSpecifications().get(0).blobDuration());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        ClientDiscoveryForServiceSpecification model =
            new ClientDiscoveryForServiceSpecification()
                .withLogSpecifications(
                    Arrays
                        .asList(
                            new ClientDiscoveryForLogSpecification()
                                .withName("cyshurzafbljjgp")
                                .withDisplayName("oq")
                                .withBlobDuration("mkljavb")));
        model = BinaryData.fromObject(model).toObject(ClientDiscoveryForServiceSpecification.class);
        Assertions.assertEquals("cyshurzafbljjgp", model.logSpecifications().get(0).name());
        Assertions.assertEquals("oq", model.logSpecifications().get(0).displayName());
        Assertions.assertEquals("mkljavb", model.logSpecifications().get(0).blobDuration());
    }
}
