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

package com.azure.resourcemanager.deviceupdate.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.deviceupdate.models.PrivateEndpointUpdate;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;

public final class PrivateEndpointUpdateTests {
    @Test
    public void testDeserialize() {
        PrivateEndpointUpdate model =
            BinaryData
                .fromString(
                    "{\"id\":\"ts\",\"location\":\"jcbpwxqpsrknft\",\"immutableSubscriptionId\":\"vriuhprwmdyvx\",\"immutableResourceId\":\"ayriwwroyqbexrm\",\"vnetTrafficTag\":\"ibycno\"}")
                .toObject(PrivateEndpointUpdate.class);
        Assertions.assertEquals("ts", model.id());
        Assertions.assertEquals("jcbpwxqpsrknft", model.location());
        Assertions.assertEquals("vriuhprwmdyvx", model.immutableSubscriptionId());
        Assertions.assertEquals("ayriwwroyqbexrm", model.immutableResourceId());
        Assertions.assertEquals("ibycno", model.vnetTrafficTag());
    }

    @Test
    public void testSerialize() {
        PrivateEndpointUpdate model =
            new PrivateEndpointUpdate()
                .withId("ts")
                .withLocation("jcbpwxqpsrknft")
                .withImmutableSubscriptionId("vriuhprwmdyvx")
                .withImmutableResourceId("ayriwwroyqbexrm")
                .withVnetTrafficTag("ibycno");
        model = BinaryData.fromObject(model).toObject(PrivateEndpointUpdate.class);
        Assertions.assertEquals("ts", model.id());
        Assertions.assertEquals("jcbpwxqpsrknft", model.location());
        Assertions.assertEquals("vriuhprwmdyvx", model.immutableSubscriptionId());
        Assertions.assertEquals("ayriwwroyqbexrm", model.immutableResourceId());
        Assertions.assertEquals("ibycno", model.vnetTrafficTag());
    }
}
