// 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.IntegrationAccountPartnerProperties;
import com.azure.resourcemanager.logic.models.B2BPartnerContent;
import com.azure.resourcemanager.logic.models.PartnerContent;
import com.azure.resourcemanager.logic.models.PartnerType;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;

public final class IntegrationAccountPartnerPropertiesTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        IntegrationAccountPartnerProperties model =
            BinaryData
                .fromString(
                    "{\"partnerType\":\"B2B\",\"createdTime\":\"2021-12-09T14:22:52Z\",\"changedTime\":\"2021-07-04T20:55:26Z\",\"metadata\":\"datauzvx\",\"content\":{\"b2b\":{\"businessIdentities\":[]}}}")
                .toObject(IntegrationAccountPartnerProperties.class);
        Assertions.assertEquals(PartnerType.B2B, model.partnerType());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        IntegrationAccountPartnerProperties model =
            new IntegrationAccountPartnerProperties()
                .withPartnerType(PartnerType.B2B)
                .withMetadata("datauzvx")
                .withContent(
                    new PartnerContent().withB2B(new B2BPartnerContent().withBusinessIdentities(Arrays.asList())));
        model = BinaryData.fromObject(model).toObject(IntegrationAccountPartnerProperties.class);
        Assertions.assertEquals(PartnerType.B2B, model.partnerType());
    }
}
