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

package com.azure.resourcemanager.security.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.security.models.CefExternalSecuritySolution;
import com.azure.resourcemanager.security.models.CefSolutionProperties;
import com.azure.resourcemanager.security.models.ConnectedWorkspace;
import org.junit.jupiter.api.Assertions;

public final class CefExternalSecuritySolutionTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        CefExternalSecuritySolution model =
            BinaryData
                .fromString(
                    "{\"kind\":\"CEF\",\"properties\":{\"hostname\":\"qacdmkxwxdcvjwcy\",\"agent\":\"akeciqchx\",\"lastEventReceived\":\"uicdsiwdfmmpzhzz\",\"deviceVendor\":\"ywrgyngydgr\",\"deviceType\":\"n\",\"workspace\":{\"id\":\"iqao\"},\"\":{\"lvlmfej\":\"datarkclamg\"}},\"location\":\"qey\",\"id\":\"gltygxhqfgq\",\"name\":\"ayejsxtlgflwfgz\",\"type\":\"iucijjcea\"}")
                .toObject(CefExternalSecuritySolution.class);
        Assertions.assertEquals("ywrgyngydgr", model.properties().deviceVendor());
        Assertions.assertEquals("n", model.properties().deviceType());
        Assertions.assertEquals("iqao", model.properties().workspace().id());
        Assertions.assertEquals("qacdmkxwxdcvjwcy", model.properties().hostname());
        Assertions.assertEquals("akeciqchx", model.properties().agent());
        Assertions.assertEquals("uicdsiwdfmmpzhzz", model.properties().lastEventReceived());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        CefExternalSecuritySolution model =
            new CefExternalSecuritySolution()
                .withProperties(
                    new CefSolutionProperties()
                        .withDeviceVendor("ywrgyngydgr")
                        .withDeviceType("n")
                        .withWorkspace(new ConnectedWorkspace().withId("iqao"))
                        .withHostname("qacdmkxwxdcvjwcy")
                        .withAgent("akeciqchx")
                        .withLastEventReceived("uicdsiwdfmmpzhzz"));
        model = BinaryData.fromObject(model).toObject(CefExternalSecuritySolution.class);
        Assertions.assertEquals("ywrgyngydgr", model.properties().deviceVendor());
        Assertions.assertEquals("n", model.properties().deviceType());
        Assertions.assertEquals("iqao", model.properties().workspace().id());
        Assertions.assertEquals("qacdmkxwxdcvjwcy", model.properties().hostname());
        Assertions.assertEquals("akeciqchx", model.properties().agent());
        Assertions.assertEquals("uicdsiwdfmmpzhzz", model.properties().lastEventReceived());
    }
}
