// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.resourcemanager.securitydevops.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.securitydevops.models.ActionableRemediation;
import com.azure.resourcemanager.securitydevops.models.ActionableRemediationState;
import com.azure.resourcemanager.securitydevops.models.RuleCategory;
import com.azure.resourcemanager.securitydevops.models.TargetBranchConfiguration;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;

public final class ActionableRemediationTests {
    @Test
    public void testDeserialize() {
        ActionableRemediation model =
            BinaryData
                .fromString(
                    "{\"state\":\"None\",\"severityLevels\":[\"olniwpwcukjf\",\"giawx\",\"lryplwckbasyy\",\"nddhsgcbacph\"],\"categories\":[\"Dependencies\"],\"branchConfiguration\":{\"names\":[\"qgoulznd\",\"i\",\"wyqkgfgibm\"]}}")
                .toObject(ActionableRemediation.class);
        Assertions.assertEquals(ActionableRemediationState.NONE, model.state());
        Assertions.assertEquals("olniwpwcukjf", model.severityLevels().get(0));
        Assertions.assertEquals(RuleCategory.DEPENDENCIES, model.categories().get(0));
        Assertions.assertEquals("qgoulznd", model.branchConfiguration().names().get(0));
    }

    @Test
    public void testSerialize() {
        ActionableRemediation model =
            new ActionableRemediation()
                .withState(ActionableRemediationState.NONE)
                .withSeverityLevels(Arrays.asList("olniwpwcukjf", "giawx", "lryplwckbasyy", "nddhsgcbacph"))
                .withCategories(Arrays.asList(RuleCategory.DEPENDENCIES))
                .withBranchConfiguration(
                    new TargetBranchConfiguration().withNames(Arrays.asList("qgoulznd", "i", "wyqkgfgibm")));
        model = BinaryData.fromObject(model).toObject(ActionableRemediation.class);
        Assertions.assertEquals(ActionableRemediationState.NONE, model.state());
        Assertions.assertEquals("olniwpwcukjf", model.severityLevels().get(0));
        Assertions.assertEquals(RuleCategory.DEPENDENCIES, model.categories().get(0));
        Assertions.assertEquals("qgoulznd", model.branchConfiguration().names().get(0));
    }
}
