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

package com.azure.resourcemanager.costmanagement.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.costmanagement.fluent.models.ReportUrl;
import com.azure.resourcemanager.costmanagement.models.ReservationReportSchema;
import java.time.OffsetDateTime;
import org.junit.jupiter.api.Assertions;

public final class ReportUrlTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        ReportUrl model =
            BinaryData
                .fromString("{\"reportUrl\":\"InstanceFlexibilityRatio\",\"validUntil\":\"2021-12-07T02:37:58Z\"}")
                .toObject(ReportUrl.class);
        Assertions.assertEquals(ReservationReportSchema.INSTANCE_FLEXIBILITY_RATIO, model.reportUrl());
        Assertions.assertEquals(OffsetDateTime.parse("2021-12-07T02:37:58Z"), model.validUntil());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        ReportUrl model =
            new ReportUrl()
                .withReportUrl(ReservationReportSchema.INSTANCE_FLEXIBILITY_RATIO)
                .withValidUntil(OffsetDateTime.parse("2021-12-07T02:37:58Z"));
        model = BinaryData.fromObject(model).toObject(ReportUrl.class);
        Assertions.assertEquals(ReservationReportSchema.INSTANCE_FLEXIBILITY_RATIO, model.reportUrl());
        Assertions.assertEquals(OffsetDateTime.parse("2021-12-07T02:37:58Z"), model.validUntil());
    }
}
