// 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.fluent.models.SecuritySolutionProperties;
import com.azure.resourcemanager.security.models.ProvisioningState;
import com.azure.resourcemanager.security.models.SecurityFamily;
import org.junit.jupiter.api.Assertions;

public final class SecuritySolutionPropertiesTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        SecuritySolutionProperties model =
            BinaryData
                .fromString(
                    "{\"securityFamily\":\"Waf\",\"provisioningState\":\"Failed\",\"template\":\"lgmtrwahzjmucf\",\"protectionStatus\":\"byrplrohkpig\"}")
                .toObject(SecuritySolutionProperties.class);
        Assertions.assertEquals(SecurityFamily.WAF, model.securityFamily());
        Assertions.assertEquals(ProvisioningState.FAILED, model.provisioningState());
        Assertions.assertEquals("lgmtrwahzjmucf", model.template());
        Assertions.assertEquals("byrplrohkpig", model.protectionStatus());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        SecuritySolutionProperties model =
            new SecuritySolutionProperties()
                .withSecurityFamily(SecurityFamily.WAF)
                .withProvisioningState(ProvisioningState.FAILED)
                .withTemplate("lgmtrwahzjmucf")
                .withProtectionStatus("byrplrohkpig");
        model = BinaryData.fromObject(model).toObject(SecuritySolutionProperties.class);
        Assertions.assertEquals(SecurityFamily.WAF, model.securityFamily());
        Assertions.assertEquals(ProvisioningState.FAILED, model.provisioningState());
        Assertions.assertEquals("lgmtrwahzjmucf", model.template());
        Assertions.assertEquals("byrplrohkpig", model.protectionStatus());
    }
}
