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

package com.azure.resourcemanager.managedapplications.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.managedapplications.models.ApplicationProviderAuthorization;
import org.junit.jupiter.api.Assertions;

public final class ApplicationProviderAuthorizationTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        ApplicationProviderAuthorization model =
            BinaryData
                .fromString("{\"principalId\":\"ifiyipjxsqwpgrj\",\"roleDefinitionId\":\"znorcj\"}")
                .toObject(ApplicationProviderAuthorization.class);
        Assertions.assertEquals("ifiyipjxsqwpgrj", model.principalId());
        Assertions.assertEquals("znorcj", model.roleDefinitionId());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        ApplicationProviderAuthorization model =
            new ApplicationProviderAuthorization().withPrincipalId("ifiyipjxsqwpgrj").withRoleDefinitionId("znorcj");
        model = BinaryData.fromObject(model).toObject(ApplicationProviderAuthorization.class);
        Assertions.assertEquals("ifiyipjxsqwpgrj", model.principalId());
        Assertions.assertEquals("znorcj", model.roleDefinitionId());
    }
}
