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

public final class AadExternalSecuritySolutionTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        AadExternalSecuritySolution model =
            BinaryData
                .fromString(
                    "{\"kind\":\"AAD\",\"properties\":{\"connectivityState\":\"NotLicensed\",\"deviceVendor\":\"pezkis\",\"deviceType\":\"jm\",\"workspace\":{\"id\":\"syparybjufp\"},\"\":{\"uiyqvldaswvppi\":\"dataczjnc\",\"rr\":\"dataqqzlgcndhz\",\"uww\":\"datacfsrhkhgsn\"}},\"location\":\"phefsbzxlbz\",\"id\":\"omeikjcl\",\"name\":\"zacn\",\"type\":\"wpfsuqtaaz\"}")
                .toObject(AadExternalSecuritySolution.class);
        Assertions.assertEquals("pezkis", model.properties().deviceVendor());
        Assertions.assertEquals("jm", model.properties().deviceType());
        Assertions.assertEquals("syparybjufp", model.properties().workspace().id());
        Assertions.assertEquals(AadConnectivityState.NOT_LICENSED, model.properties().connectivityState());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        AadExternalSecuritySolution model =
            new AadExternalSecuritySolution()
                .withProperties(
                    new AadSolutionProperties()
                        .withDeviceVendor("pezkis")
                        .withDeviceType("jm")
                        .withWorkspace(new ConnectedWorkspace().withId("syparybjufp"))
                        .withConnectivityState(AadConnectivityState.NOT_LICENSED));
        model = BinaryData.fromObject(model).toObject(AadExternalSecuritySolution.class);
        Assertions.assertEquals("pezkis", model.properties().deviceVendor());
        Assertions.assertEquals("jm", model.properties().deviceType());
        Assertions.assertEquals("syparybjufp", model.properties().workspace().id());
        Assertions.assertEquals(AadConnectivityState.NOT_LICENSED, model.properties().connectivityState());
    }
}
