// 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.fluent.models.FirewallRuleInner;
import org.junit.jupiter.api.Assertions;

public final class FirewallRuleInnerTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        FirewallRuleInner model =
            BinaryData
                .fromString(
                    "{\"properties\":{\"startIpAddress\":\"sycbkbfk\",\"endIpAddress\":\"ukdkexxppofmxa\",\"provisioningState\":\"Failed\"},\"id\":\"pg\",\"name\":\"dtocj\",\"type\":\"xhvpmoue\"}")
                .toObject(FirewallRuleInner.class);
        Assertions.assertEquals("sycbkbfk", model.startIpAddress());
        Assertions.assertEquals("ukdkexxppofmxa", model.endIpAddress());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        FirewallRuleInner model =
            new FirewallRuleInner().withStartIpAddress("sycbkbfk").withEndIpAddress("ukdkexxppofmxa");
        model = BinaryData.fromObject(model).toObject(FirewallRuleInner.class);
        Assertions.assertEquals("sycbkbfk", model.startIpAddress());
        Assertions.assertEquals("ukdkexxppofmxa", model.endIpAddress());
    }
}
