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

package com.azure.resourcemanager.logic.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.logic.fluent.models.IntegrationAccountProperties;
import com.azure.resourcemanager.logic.models.ResourceReference;
import com.azure.resourcemanager.logic.models.WorkflowState;
import org.junit.jupiter.api.Assertions;

public final class IntegrationAccountPropertiesTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        IntegrationAccountProperties model =
            BinaryData
                .fromString(
                    "{\"integrationServiceEnvironment\":{\"id\":\"ahwfluszdtmhrk\",\"name\":\"fyyvoq\",\"type\":\"piexpbtgiw\"},\"state\":\"NotSpecified\"}")
                .toObject(IntegrationAccountProperties.class);
        Assertions.assertEquals("ahwfluszdtmhrk", model.integrationServiceEnvironment().id());
        Assertions.assertEquals(WorkflowState.NOT_SPECIFIED, model.state());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        IntegrationAccountProperties model =
            new IntegrationAccountProperties()
                .withIntegrationServiceEnvironment(new ResourceReference().withId("ahwfluszdtmhrk"))
                .withState(WorkflowState.NOT_SPECIFIED);
        model = BinaryData.fromObject(model).toObject(IntegrationAccountProperties.class);
        Assertions.assertEquals("ahwfluszdtmhrk", model.integrationServiceEnvironment().id());
        Assertions.assertEquals(WorkflowState.NOT_SPECIFIED, model.state());
    }
}
