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

package com.azure.resourcemanager.agrifood.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.agrifood.models.FarmBeatsUpdateProperties;
import com.azure.resourcemanager.agrifood.models.PublicNetworkAccess;
import com.azure.resourcemanager.agrifood.models.SensorIntegration;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;

public final class FarmBeatsUpdatePropertiesTests {
    @Test
    public void testDeserialize() {
        FarmBeatsUpdateProperties model =
            BinaryData
                .fromString(
                    "{\"sensorIntegration\":{\"enabled\":\"gmaajrm\",\"provisioningState\":\"Succeeded\"},\"publicNetworkAccess\":\"Hybrid\"}")
                .toObject(FarmBeatsUpdateProperties.class);
        Assertions.assertEquals("gmaajrm", model.sensorIntegration().enabled());
        Assertions.assertEquals(PublicNetworkAccess.HYBRID, model.publicNetworkAccess());
    }

    @Test
    public void testSerialize() {
        FarmBeatsUpdateProperties model =
            new FarmBeatsUpdateProperties()
                .withSensorIntegration(new SensorIntegration().withEnabled("gmaajrm"))
                .withPublicNetworkAccess(PublicNetworkAccess.HYBRID);
        model = BinaryData.fromObject(model).toObject(FarmBeatsUpdateProperties.class);
        Assertions.assertEquals("gmaajrm", model.sensorIntegration().enabled());
        Assertions.assertEquals(PublicNetworkAccess.HYBRID, model.publicNetworkAccess());
    }
}
