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

package com.azure.resourcemanager.databox.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.databox.models.CustomerResolutionCode;
import com.azure.resourcemanager.databox.models.LastMitigationActionOnJob;
import java.time.OffsetDateTime;
import org.junit.jupiter.api.Assertions;

public final class LastMitigationActionOnJobTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        LastMitigationActionOnJob model =
            BinaryData
                .fromString(
                    "{\"actionDateTimeInUtc\":\"2021-04-14T04:20:05Z\",\"isPerformedByCustomer\":false,\"customerResolution\":\"Resume\"}")
                .toObject(LastMitigationActionOnJob.class);
        Assertions.assertEquals(OffsetDateTime.parse("2021-04-14T04:20:05Z"), model.actionDateTimeInUtc());
        Assertions.assertEquals(false, model.isPerformedByCustomer());
        Assertions.assertEquals(CustomerResolutionCode.RESUME, model.customerResolution());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        LastMitigationActionOnJob model =
            new LastMitigationActionOnJob()
                .withActionDateTimeInUtc(OffsetDateTime.parse("2021-04-14T04:20:05Z"))
                .withIsPerformedByCustomer(false)
                .withCustomerResolution(CustomerResolutionCode.RESUME);
        model = BinaryData.fromObject(model).toObject(LastMitigationActionOnJob.class);
        Assertions.assertEquals(OffsetDateTime.parse("2021-04-14T04:20:05Z"), model.actionDateTimeInUtc());
        Assertions.assertEquals(false, model.isPerformedByCustomer());
        Assertions.assertEquals(CustomerResolutionCode.RESUME, model.customerResolution());
    }
}
