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

public final class DiscoveredSecuritySolutionInnerTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        DiscoveredSecuritySolutionInner model =
            BinaryData
                .fromString(
                    "{\"properties\":{\"securityFamily\":\"Waf\",\"offer\":\"pbswvefloccsrm\",\"publisher\":\"zihmipgawtxxpky\",\"sku\":\"cxcjxgry\"},\"location\":\"mpcycilrmcaykgg\",\"id\":\"oxuztrksx\",\"name\":\"pndfcpfnznt\",\"type\":\"jtwkjaos\"}")
                .toObject(DiscoveredSecuritySolutionInner.class);
        Assertions.assertEquals(SecurityFamily.WAF, model.securityFamily());
        Assertions.assertEquals("pbswvefloccsrm", model.offer());
        Assertions.assertEquals("zihmipgawtxxpky", model.publisher());
        Assertions.assertEquals("cxcjxgry", model.sku());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        DiscoveredSecuritySolutionInner model =
            new DiscoveredSecuritySolutionInner()
                .withSecurityFamily(SecurityFamily.WAF)
                .withOffer("pbswvefloccsrm")
                .withPublisher("zihmipgawtxxpky")
                .withSku("cxcjxgry");
        model = BinaryData.fromObject(model).toObject(DiscoveredSecuritySolutionInner.class);
        Assertions.assertEquals(SecurityFamily.WAF, model.securityFamily());
        Assertions.assertEquals("pbswvefloccsrm", model.offer());
        Assertions.assertEquals("zihmipgawtxxpky", model.publisher());
        Assertions.assertEquals("cxcjxgry", model.sku());
    }
}
