// 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.GcpOrganizationalData;
import com.azure.resourcemanager.security.models.GcpProjectDetails;
import com.azure.resourcemanager.security.models.GcpProjectEnvironmentData;
import org.junit.jupiter.api.Assertions;

public final class GcpProjectEnvironmentDataTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        GcpProjectEnvironmentData model =
            BinaryData
                .fromString(
                    "{\"environmentType\":\"GcpProject\",\"organizationalData\":{\"organizationMembershipType\":\"GcpOrganizationalData\"},\"projectDetails\":{\"projectNumber\":\"dfpdqwtygevg\",\"projectId\":\"sehar\",\"workloadIdentityPoolId\":\"fv\",\"projectName\":\"rxtmbpjptnvw\"}}")
                .toObject(GcpProjectEnvironmentData.class);
        Assertions.assertEquals("dfpdqwtygevg", model.projectDetails().projectNumber());
        Assertions.assertEquals("sehar", model.projectDetails().projectId());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        GcpProjectEnvironmentData model =
            new GcpProjectEnvironmentData()
                .withOrganizationalData(new GcpOrganizationalData())
                .withProjectDetails(new GcpProjectDetails().withProjectNumber("dfpdqwtygevg").withProjectId("sehar"));
        model = BinaryData.fromObject(model).toObject(GcpProjectEnvironmentData.class);
        Assertions.assertEquals("dfpdqwtygevg", model.projectDetails().projectNumber());
        Assertions.assertEquals("sehar", model.projectDetails().projectId());
    }
}
