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

package com.azure.resourcemanager.appcontainers.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.appcontainers.models.AllowedPrincipals;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;

public final class AllowedPrincipalsTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        AllowedPrincipals model =
            BinaryData
                .fromString("{\"groups\":[\"ddhsgcbacphe\",\"koty\",\"qgoulznd\"],\"identities\":[\"wyqkgfgibm\"]}")
                .toObject(AllowedPrincipals.class);
        Assertions.assertEquals("ddhsgcbacphe", model.groups().get(0));
        Assertions.assertEquals("wyqkgfgibm", model.identities().get(0));
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        AllowedPrincipals model =
            new AllowedPrincipals()
                .withGroups(Arrays.asList("ddhsgcbacphe", "koty", "qgoulznd"))
                .withIdentities(Arrays.asList("wyqkgfgibm"));
        model = BinaryData.fromObject(model).toObject(AllowedPrincipals.class);
        Assertions.assertEquals("ddhsgcbacphe", model.groups().get(0));
        Assertions.assertEquals("wyqkgfgibm", model.identities().get(0));
    }
}
