// 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.ApplicationInner;
import com.azure.resourcemanager.security.models.ApplicationSourceResourceType;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;

public final class ApplicationInnerTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        ApplicationInner model =
            BinaryData
                .fromString(
                    "{\"properties\":{\"displayName\":\"cfehuwaoagu\",\"description\":\"cqlliz\",\"sourceResourceType\":\"Assessments\",\"conditionSets\":[\"datacsjvhrwef\"]},\"id\":\"kwqejpmvsseh\",\"name\":\"epwamcxtcz\",\"type\":\"upeuknijduyye\"}")
                .toObject(ApplicationInner.class);
        Assertions.assertEquals("cfehuwaoagu", model.displayName());
        Assertions.assertEquals("cqlliz", model.description());
        Assertions.assertEquals(ApplicationSourceResourceType.ASSESSMENTS, model.sourceResourceType());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        ApplicationInner model =
            new ApplicationInner()
                .withDisplayName("cfehuwaoagu")
                .withDescription("cqlliz")
                .withSourceResourceType(ApplicationSourceResourceType.ASSESSMENTS)
                .withConditionSets(Arrays.asList("datacsjvhrwef"));
        model = BinaryData.fromObject(model).toObject(ApplicationInner.class);
        Assertions.assertEquals("cfehuwaoagu", model.displayName());
        Assertions.assertEquals("cqlliz", model.description());
        Assertions.assertEquals(ApplicationSourceResourceType.ASSESSMENTS, model.sourceResourceType());
    }
}
