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

public final class SecuritySolutionsReferenceDataTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        SecuritySolutionsReferenceData model =
            BinaryData
                .fromString(
                    "{\"properties\":{\"securityFamily\":\"Waf\",\"alertVendorName\":\"rqunjq\",\"packageInfoUrl\":\"denxau\",\"productName\":\"kpak\",\"publisher\":\"kifmjn\",\"publisherDisplayName\":\"awtqabpxuckpgg\",\"template\":\"oweyirdhlis\"},\"location\":\"wfl\",\"id\":\"qmp\",\"name\":\"zruwn\",\"type\":\"qxpxiwfcngjsaa\"}")
                .toObject(SecuritySolutionsReferenceData.class);
        Assertions.assertEquals(SecurityFamily.WAF, model.securityFamily());
        Assertions.assertEquals("rqunjq", model.alertVendorName());
        Assertions.assertEquals("denxau", model.packageInfoUrl());
        Assertions.assertEquals("kpak", model.productName());
        Assertions.assertEquals("kifmjn", model.publisher());
        Assertions.assertEquals("awtqabpxuckpgg", model.publisherDisplayName());
        Assertions.assertEquals("oweyirdhlis", model.template());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        SecuritySolutionsReferenceData model =
            new SecuritySolutionsReferenceData()
                .withSecurityFamily(SecurityFamily.WAF)
                .withAlertVendorName("rqunjq")
                .withPackageInfoUrl("denxau")
                .withProductName("kpak")
                .withPublisher("kifmjn")
                .withPublisherDisplayName("awtqabpxuckpgg")
                .withTemplate("oweyirdhlis");
        model = BinaryData.fromObject(model).toObject(SecuritySolutionsReferenceData.class);
        Assertions.assertEquals(SecurityFamily.WAF, model.securityFamily());
        Assertions.assertEquals("rqunjq", model.alertVendorName());
        Assertions.assertEquals("denxau", model.packageInfoUrl());
        Assertions.assertEquals("kpak", model.productName());
        Assertions.assertEquals("kifmjn", model.publisher());
        Assertions.assertEquals("awtqabpxuckpgg", model.publisherDisplayName());
        Assertions.assertEquals("oweyirdhlis", model.template());
    }
}
