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

package com.azure.resourcemanager.mysqlflexibleserver.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.mysqlflexibleserver.fluent.models.AdministratorProperties;
import com.azure.resourcemanager.mysqlflexibleserver.models.AdministratorType;
import org.junit.jupiter.api.Assertions;

public final class AdministratorPropertiesTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        AdministratorProperties model =
            BinaryData
                .fromString(
                    "{\"administratorType\":\"ActiveDirectory\",\"login\":\"muf\",\"sid\":\"wnoi\",\"tenantId\":\"wlrxyb\",\"identityResourceId\":\"oqijgkdmbpaz\"}")
                .toObject(AdministratorProperties.class);
        Assertions.assertEquals(AdministratorType.ACTIVE_DIRECTORY, model.administratorType());
        Assertions.assertEquals("muf", model.login());
        Assertions.assertEquals("wnoi", model.sid());
        Assertions.assertEquals("wlrxyb", model.tenantId());
        Assertions.assertEquals("oqijgkdmbpaz", model.identityResourceId());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        AdministratorProperties model =
            new AdministratorProperties()
                .withAdministratorType(AdministratorType.ACTIVE_DIRECTORY)
                .withLogin("muf")
                .withSid("wnoi")
                .withTenantId("wlrxyb")
                .withIdentityResourceId("oqijgkdmbpaz");
        model = BinaryData.fromObject(model).toObject(AdministratorProperties.class);
        Assertions.assertEquals(AdministratorType.ACTIVE_DIRECTORY, model.administratorType());
        Assertions.assertEquals("muf", model.login());
        Assertions.assertEquals("wnoi", model.sid());
        Assertions.assertEquals("wlrxyb", model.tenantId());
        Assertions.assertEquals("oqijgkdmbpaz", model.identityResourceId());
    }
}
