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

package com.azure.resourcemanager.cosmosdbforpostgresql.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.cosmosdbforpostgresql.models.ServerRole;
import com.azure.resourcemanager.cosmosdbforpostgresql.models.ServerRoleGroupConfiguration;
import org.junit.jupiter.api.Assertions;

public final class ServerRoleGroupConfigurationTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        ServerRoleGroupConfiguration model =
            BinaryData
                .fromString(
                    "{\"role\":\"Coordinator\",\"value\":\"maajrmvdjwzrlo\",\"defaultValue\":\"clwhijcoejctbz\",\"source\":\"s\"}")
                .toObject(ServerRoleGroupConfiguration.class);
        Assertions.assertEquals(ServerRole.COORDINATOR, model.role());
        Assertions.assertEquals("maajrmvdjwzrlo", model.value());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        ServerRoleGroupConfiguration model =
            new ServerRoleGroupConfiguration().withRole(ServerRole.COORDINATOR).withValue("maajrmvdjwzrlo");
        model = BinaryData.fromObject(model).toObject(ServerRoleGroupConfiguration.class);
        Assertions.assertEquals(ServerRole.COORDINATOR, model.role());
        Assertions.assertEquals("maajrmvdjwzrlo", model.value());
    }
}
