// 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.CustomAssessmentAutomationRequest;
import com.azure.resourcemanager.security.models.SeverityEnum;
import com.azure.resourcemanager.security.models.SupportedCloudEnum;
import org.junit.jupiter.api.Assertions;

public final class CustomAssessmentAutomationRequestTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        CustomAssessmentAutomationRequest model =
            BinaryData
                .fromString(
                    "{\"properties\":{\"compressedQuery\":\"xhekuksjtxukcdm\",\"supportedCloud\":\"GCP\",\"severity\":\"Low\",\"displayName\":\"uanzwuxzdx\",\"description\":\"yrlhmwhfpmrqobm\",\"remediationDescription\":\"kknryrtihf\"},\"id\":\"tijbpzvgnwzsymgl\",\"name\":\"uf\",\"type\":\"yzkohdbihanuf\"}")
                .toObject(CustomAssessmentAutomationRequest.class);
        Assertions.assertEquals("xhekuksjtxukcdm", model.compressedQuery());
        Assertions.assertEquals(SupportedCloudEnum.GCP, model.supportedCloud());
        Assertions.assertEquals(SeverityEnum.LOW, model.severity());
        Assertions.assertEquals("uanzwuxzdx", model.displayName());
        Assertions.assertEquals("yrlhmwhfpmrqobm", model.description());
        Assertions.assertEquals("kknryrtihf", model.remediationDescription());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        CustomAssessmentAutomationRequest model =
            new CustomAssessmentAutomationRequest()
                .withCompressedQuery("xhekuksjtxukcdm")
                .withSupportedCloud(SupportedCloudEnum.GCP)
                .withSeverity(SeverityEnum.LOW)
                .withDisplayName("uanzwuxzdx")
                .withDescription("yrlhmwhfpmrqobm")
                .withRemediationDescription("kknryrtihf");
        model = BinaryData.fromObject(model).toObject(CustomAssessmentAutomationRequest.class);
        Assertions.assertEquals("xhekuksjtxukcdm", model.compressedQuery());
        Assertions.assertEquals(SupportedCloudEnum.GCP, model.supportedCloud());
        Assertions.assertEquals(SeverityEnum.LOW, model.severity());
        Assertions.assertEquals("uanzwuxzdx", model.displayName());
        Assertions.assertEquals("yrlhmwhfpmrqobm", model.description());
        Assertions.assertEquals("kknryrtihf", model.remediationDescription());
    }
}
