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

package com.azure.resourcemanager.resourcehealth.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.resourcehealth.models.StatusBanner;
import java.time.OffsetDateTime;
import org.junit.jupiter.api.Assertions;

public final class StatusBannerTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        StatusBanner model =
            BinaryData
                .fromString(
                    "{\"title\":\"wptfdy\",\"message\":\"fqbuaceopzf\",\"cloud\":\"hhuao\",\"lastModifiedTime\":\"2021-03-20T16:48:49Z\"}")
                .toObject(StatusBanner.class);
        Assertions.assertEquals("wptfdy", model.title());
        Assertions.assertEquals("fqbuaceopzf", model.message());
        Assertions.assertEquals("hhuao", model.cloud());
        Assertions.assertEquals(OffsetDateTime.parse("2021-03-20T16:48:49Z"), model.lastModifiedTime());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        StatusBanner model =
            new StatusBanner()
                .withTitle("wptfdy")
                .withMessage("fqbuaceopzf")
                .withCloud("hhuao")
                .withLastModifiedTime(OffsetDateTime.parse("2021-03-20T16:48:49Z"));
        model = BinaryData.fromObject(model).toObject(StatusBanner.class);
        Assertions.assertEquals("wptfdy", model.title());
        Assertions.assertEquals("fqbuaceopzf", model.message());
        Assertions.assertEquals("hhuao", model.cloud());
        Assertions.assertEquals(OffsetDateTime.parse("2021-03-20T16:48:49Z"), model.lastModifiedTime());
    }
}
