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

package com.azure.resourcemanager.paloaltonetworks.ngfw.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.paloaltonetworks.ngfw.models.MarketplaceDetails;
import com.azure.resourcemanager.paloaltonetworks.ngfw.models.MarketplaceSubscriptionStatus;
import org.junit.jupiter.api.Assertions;

public final class MarketplaceDetailsTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        MarketplaceDetails model =
            BinaryData
                .fromString(
                    "{\"marketplaceSubscriptionId\":\"kpzi\",\"offerId\":\"ejzanlfz\",\"publisherId\":\"iavrm\",\"marketplaceSubscriptionStatus\":\"FulfillmentRequested\"}")
                .toObject(MarketplaceDetails.class);
        Assertions.assertEquals("ejzanlfz", model.offerId());
        Assertions.assertEquals("iavrm", model.publisherId());
        Assertions
            .assertEquals(MarketplaceSubscriptionStatus.FULFILLMENT_REQUESTED, model.marketplaceSubscriptionStatus());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        MarketplaceDetails model =
            new MarketplaceDetails()
                .withOfferId("ejzanlfz")
                .withPublisherId("iavrm")
                .withMarketplaceSubscriptionStatus(MarketplaceSubscriptionStatus.FULFILLMENT_REQUESTED);
        model = BinaryData.fromObject(model).toObject(MarketplaceDetails.class);
        Assertions.assertEquals("ejzanlfz", model.offerId());
        Assertions.assertEquals("iavrm", model.publisherId());
        Assertions
            .assertEquals(MarketplaceSubscriptionStatus.FULFILLMENT_REQUESTED, model.marketplaceSubscriptionStatus());
    }
}
