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

package com.azure.resourcemanager.logz.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.logz.fluent.models.LogzSingleSignOnResourceInner;
import com.azure.resourcemanager.logz.models.LogzSingleSignOnProperties;
import com.azure.resourcemanager.logz.models.LogzSingleSignOnResourceListResponse;
import com.azure.resourcemanager.logz.models.SingleSignOnStates;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;

public final class LogzSingleSignOnResourceListResponseTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        LogzSingleSignOnResourceListResponse model =
            BinaryData
                .fromString(
                    "{\"value\":[{\"properties\":{\"singleSignOnState\":\"Existing\",\"enterpriseAppId\":\"mqc\",\"singleSignOnUrl\":\"q\",\"provisioningState\":\"Deleted\"},\"id\":\"hix\",\"name\":\"igdtopbob\",\"type\":\"og\"},{\"properties\":{\"singleSignOnState\":\"Initial\",\"enterpriseAppId\":\"m\",\"singleSignOnUrl\":\"hrzayvvtpgvdf\",\"provisioningState\":\"Deleted\"},\"id\":\"tkftutqxlngx\",\"name\":\"efgugnxk\",\"type\":\"xdqmidtthzrvqdra\"}],\"nextLink\":\"jybige\"}")
                .toObject(LogzSingleSignOnResourceListResponse.class);
        Assertions.assertEquals(SingleSignOnStates.EXISTING, model.value().get(0).properties().singleSignOnState());
        Assertions.assertEquals("mqc", model.value().get(0).properties().enterpriseAppId());
        Assertions.assertEquals("q", model.value().get(0).properties().singleSignOnUrl());
        Assertions.assertEquals("jybige", model.nextLink());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        LogzSingleSignOnResourceListResponse model =
            new LogzSingleSignOnResourceListResponse()
                .withValue(
                    Arrays
                        .asList(
                            new LogzSingleSignOnResourceInner()
                                .withProperties(
                                    new LogzSingleSignOnProperties()
                                        .withSingleSignOnState(SingleSignOnStates.EXISTING)
                                        .withEnterpriseAppId("mqc")
                                        .withSingleSignOnUrl("q")),
                            new LogzSingleSignOnResourceInner()
                                .withProperties(
                                    new LogzSingleSignOnProperties()
                                        .withSingleSignOnState(SingleSignOnStates.INITIAL)
                                        .withEnterpriseAppId("m")
                                        .withSingleSignOnUrl("hrzayvvtpgvdf"))))
                .withNextLink("jybige");
        model = BinaryData.fromObject(model).toObject(LogzSingleSignOnResourceListResponse.class);
        Assertions.assertEquals(SingleSignOnStates.EXISTING, model.value().get(0).properties().singleSignOnState());
        Assertions.assertEquals("mqc", model.value().get(0).properties().enterpriseAppId());
        Assertions.assertEquals("q", model.value().get(0).properties().singleSignOnUrl());
        Assertions.assertEquals("jybige", model.nextLink());
    }
}
