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

package com.azure.resourcemanager.batch.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.batch.models.IpAddressProvisioningType;
import com.azure.resourcemanager.batch.models.PublicIpAddressConfiguration;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;

public final class PublicIpAddressConfigurationTests {
    @Test
    public void testDeserialize() {
        PublicIpAddressConfiguration model =
            BinaryData
                .fromString("{\"provision\":\"UserManaged\",\"ipAddressIds\":[\"mutwuoe\",\"rpkhjwn\"]}")
                .toObject(PublicIpAddressConfiguration.class);
        Assertions.assertEquals(IpAddressProvisioningType.USER_MANAGED, model.provision());
        Assertions.assertEquals("mutwuoe", model.ipAddressIds().get(0));
    }

    @Test
    public void testSerialize() {
        PublicIpAddressConfiguration model =
            new PublicIpAddressConfiguration()
                .withProvision(IpAddressProvisioningType.USER_MANAGED)
                .withIpAddressIds(Arrays.asList("mutwuoe", "rpkhjwn"));
        model = BinaryData.fromObject(model).toObject(PublicIpAddressConfiguration.class);
        Assertions.assertEquals(IpAddressProvisioningType.USER_MANAGED, model.provision());
        Assertions.assertEquals("mutwuoe", model.ipAddressIds().get(0));
    }
}
