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

package com.azure.resourcemanager.databoxedge.generated;

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

public final class RefreshDetailsTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        RefreshDetails model =
            BinaryData
                .fromString(
                    "{\"inProgressRefreshJobId\":\"enq\",\"lastCompletedRefreshJobTimeInUTC\":\"2021-01-20T04:38Z\",\"errorManifestFile\":\"ndoygmifthnzdnd\",\"lastJob\":\"gnayqigynduh\"}")
                .toObject(RefreshDetails.class);
        Assertions.assertEquals("enq", model.inProgressRefreshJobId());
        Assertions.assertEquals(OffsetDateTime.parse("2021-01-20T04:38Z"), model.lastCompletedRefreshJobTimeInUtc());
        Assertions.assertEquals("ndoygmifthnzdnd", model.errorManifestFile());
        Assertions.assertEquals("gnayqigynduh", model.lastJob());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        RefreshDetails model =
            new RefreshDetails()
                .withInProgressRefreshJobId("enq")
                .withLastCompletedRefreshJobTimeInUtc(OffsetDateTime.parse("2021-01-20T04:38Z"))
                .withErrorManifestFile("ndoygmifthnzdnd")
                .withLastJob("gnayqigynduh");
        model = BinaryData.fromObject(model).toObject(RefreshDetails.class);
        Assertions.assertEquals("enq", model.inProgressRefreshJobId());
        Assertions.assertEquals(OffsetDateTime.parse("2021-01-20T04:38Z"), model.lastCompletedRefreshJobTimeInUtc());
        Assertions.assertEquals("ndoygmifthnzdnd", model.errorManifestFile());
        Assertions.assertEquals("gnayqigynduh", model.lastJob());
    }
}
