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

public final class UserDefinedResourcesPropertiesTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        UserDefinedResourcesProperties model =
            BinaryData
                .fromString(
                    "{\"query\":\"lqdqgbiqylihka\",\"querySubscriptions\":[\"cktvfcivfsnkymuc\",\"qhjfbebr\",\"cxerf\",\"wutttxfvjrbi\"]}")
                .toObject(UserDefinedResourcesProperties.class);
        Assertions.assertEquals("lqdqgbiqylihka", model.query());
        Assertions.assertEquals("cktvfcivfsnkymuc", model.querySubscriptions().get(0));
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        UserDefinedResourcesProperties model =
            new UserDefinedResourcesProperties()
                .withQuery("lqdqgbiqylihka")
                .withQuerySubscriptions(Arrays.asList("cktvfcivfsnkymuc", "qhjfbebr", "cxerf", "wutttxfvjrbi"));
        model = BinaryData.fromObject(model).toObject(UserDefinedResourcesProperties.class);
        Assertions.assertEquals("lqdqgbiqylihka", model.query());
        Assertions.assertEquals("cktvfcivfsnkymuc", model.querySubscriptions().get(0));
    }
}
