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

package com.azure.resourcemanager.paloaltonetworks.ngfw.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.paloaltonetworks.ngfw.models.AppSeenData;
import com.azure.resourcemanager.paloaltonetworks.ngfw.models.AppSeenInfo;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;

public final class AppSeenDataTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        AppSeenData model =
            BinaryData
                .fromString(
                    "{\"count\":315550434,\"appSeenList\":[{\"title\":\"knalaulppg\",\"category\":\"dtpnapnyiropuhp\",\"subCategory\":\"gvpgy\",\"risk\":\"gqgitxmedjvcsl\",\"tag\":\"n\",\"technology\":\"wwncwzzhxgk\",\"standardPorts\":\"rmgucnap\"},{\"title\":\"t\",\"category\":\"oellwp\",\"subCategory\":\"fdygpfqbuaceopz\",\"risk\":\"qrhhu\",\"tag\":\"opppcqeq\",\"technology\":\"ol\",\"standardPorts\":\"dahzxctobg\"},{\"title\":\"kdmoi\",\"category\":\"postmgrcfbunrm\",\"subCategory\":\"qjhhkxbpv\",\"risk\":\"ymjhxxjyngudivkr\",\"tag\":\"swbxqz\",\"technology\":\"szjfauvjfdxxivet\",\"standardPorts\":\"t\"}]}")
                .toObject(AppSeenData.class);
        Assertions.assertEquals(315550434, model.count());
        Assertions.assertEquals("knalaulppg", model.appSeenList().get(0).title());
        Assertions.assertEquals("dtpnapnyiropuhp", model.appSeenList().get(0).category());
        Assertions.assertEquals("gvpgy", model.appSeenList().get(0).subCategory());
        Assertions.assertEquals("gqgitxmedjvcsl", model.appSeenList().get(0).risk());
        Assertions.assertEquals("n", model.appSeenList().get(0).tag());
        Assertions.assertEquals("wwncwzzhxgk", model.appSeenList().get(0).technology());
        Assertions.assertEquals("rmgucnap", model.appSeenList().get(0).standardPorts());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        AppSeenData model =
            new AppSeenData()
                .withCount(315550434)
                .withAppSeenList(
                    Arrays
                        .asList(
                            new AppSeenInfo()
                                .withTitle("knalaulppg")
                                .withCategory("dtpnapnyiropuhp")
                                .withSubCategory("gvpgy")
                                .withRisk("gqgitxmedjvcsl")
                                .withTag("n")
                                .withTechnology("wwncwzzhxgk")
                                .withStandardPorts("rmgucnap"),
                            new AppSeenInfo()
                                .withTitle("t")
                                .withCategory("oellwp")
                                .withSubCategory("fdygpfqbuaceopz")
                                .withRisk("qrhhu")
                                .withTag("opppcqeq")
                                .withTechnology("ol")
                                .withStandardPorts("dahzxctobg"),
                            new AppSeenInfo()
                                .withTitle("kdmoi")
                                .withCategory("postmgrcfbunrm")
                                .withSubCategory("qjhhkxbpv")
                                .withRisk("ymjhxxjyngudivkr")
                                .withTag("swbxqz")
                                .withTechnology("szjfauvjfdxxivet")
                                .withStandardPorts("t")));
        model = BinaryData.fromObject(model).toObject(AppSeenData.class);
        Assertions.assertEquals(315550434, model.count());
        Assertions.assertEquals("knalaulppg", model.appSeenList().get(0).title());
        Assertions.assertEquals("dtpnapnyiropuhp", model.appSeenList().get(0).category());
        Assertions.assertEquals("gvpgy", model.appSeenList().get(0).subCategory());
        Assertions.assertEquals("gqgitxmedjvcsl", model.appSeenList().get(0).risk());
        Assertions.assertEquals("n", model.appSeenList().get(0).tag());
        Assertions.assertEquals("wwncwzzhxgk", model.appSeenList().get(0).technology());
        Assertions.assertEquals("rmgucnap", model.appSeenList().get(0).standardPorts());
    }
}
