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

package com.azure.resourcemanager.maps.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.maps.models.CorsRule;
import com.azure.resourcemanager.maps.models.CorsRules;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;

public final class CorsRulesTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        CorsRules model =
            BinaryData.fromString("{\"corsRules\":[{\"allowedOrigins\":[\"jcny\"]}]}").toObject(CorsRules.class);
        Assertions.assertEquals("jcny", model.corsRules().get(0).allowedOrigins().get(0));
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        CorsRules model =
            new CorsRules().withCorsRules(Arrays.asList(new CorsRule().withAllowedOrigins(Arrays.asList("jcny"))));
        model = BinaryData.fromObject(model).toObject(CorsRules.class);
        Assertions.assertEquals("jcny", model.corsRules().get(0).allowedOrigins().get(0));
    }
}
