// 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.AtaExternalSecuritySolution;
import com.azure.resourcemanager.security.models.AtaSolutionProperties;
import com.azure.resourcemanager.security.models.ConnectedWorkspace;
import org.junit.jupiter.api.Assertions;

public final class AtaExternalSecuritySolutionTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        AtaExternalSecuritySolution model =
            BinaryData
                .fromString(
                    "{\"kind\":\"ATA\",\"properties\":{\"lastEventReceived\":\"gv\",\"deviceVendor\":\"e\",\"deviceType\":\"uoqujlyeg\",\"workspace\":{\"id\":\"nigflqqbtnyj\"},\"\":{\"vabm\":\"dataxdb\",\"wuhvaj\":\"datamsxbaevwjcnkott\",\"wjiqullqxb\":\"dataailfemjjzak\"}},\"location\":\"vr\",\"id\":\"cm\",\"name\":\"erndbrnyeofltfnn\",\"type\":\"rkadjfynnfmuiiir\"}")
                .toObject(AtaExternalSecuritySolution.class);
        Assertions.assertEquals("e", model.properties().deviceVendor());
        Assertions.assertEquals("uoqujlyeg", model.properties().deviceType());
        Assertions.assertEquals("nigflqqbtnyj", model.properties().workspace().id());
        Assertions.assertEquals("gv", model.properties().lastEventReceived());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        AtaExternalSecuritySolution model =
            new AtaExternalSecuritySolution()
                .withProperties(
                    new AtaSolutionProperties()
                        .withDeviceVendor("e")
                        .withDeviceType("uoqujlyeg")
                        .withWorkspace(new ConnectedWorkspace().withId("nigflqqbtnyj"))
                        .withLastEventReceived("gv"));
        model = BinaryData.fromObject(model).toObject(AtaExternalSecuritySolution.class);
        Assertions.assertEquals("e", model.properties().deviceVendor());
        Assertions.assertEquals("uoqujlyeg", model.properties().deviceType());
        Assertions.assertEquals("nigflqqbtnyj", model.properties().workspace().id());
        Assertions.assertEquals("gv", model.properties().lastEventReceived());
    }
}
