// 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.Remediation;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;

public final class RemediationTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        Remediation model =
            BinaryData
                .fromString(
                    "{\"description\":\"kzykjtjk\",\"scripts\":[\"fwushcdpkupn\",\"rmgjfbpkuwx\"],\"automated\":true,\"portalLink\":\"jfizfavkjzwfbc\"}")
                .toObject(Remediation.class);
        Assertions.assertEquals("kzykjtjk", model.description());
        Assertions.assertEquals("fwushcdpkupn", model.scripts().get(0));
        Assertions.assertEquals(true, model.automated());
        Assertions.assertEquals("jfizfavkjzwfbc", model.portalLink());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        Remediation model =
            new Remediation()
                .withDescription("kzykjtjk")
                .withScripts(Arrays.asList("fwushcdpkupn", "rmgjfbpkuwx"))
                .withAutomated(true)
                .withPortalLink("jfizfavkjzwfbc");
        model = BinaryData.fromObject(model).toObject(Remediation.class);
        Assertions.assertEquals("kzykjtjk", model.description());
        Assertions.assertEquals("fwushcdpkupn", model.scripts().get(0));
        Assertions.assertEquals(true, model.automated());
        Assertions.assertEquals("jfizfavkjzwfbc", model.portalLink());
    }
}
