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

package com.azure.resourcemanager.appcontainers.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.appcontainers.models.CookieExpiration;
import com.azure.resourcemanager.appcontainers.models.CookieExpirationConvention;
import org.junit.jupiter.api.Assertions;

public final class CookieExpirationTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        CookieExpiration model =
            BinaryData
                .fromString("{\"convention\":\"FixedTime\",\"timeToExpiration\":\"y\"}")
                .toObject(CookieExpiration.class);
        Assertions.assertEquals(CookieExpirationConvention.FIXED_TIME, model.convention());
        Assertions.assertEquals("y", model.timeToExpiration());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        CookieExpiration model =
            new CookieExpiration().withConvention(CookieExpirationConvention.FIXED_TIME).withTimeToExpiration("y");
        model = BinaryData.fromObject(model).toObject(CookieExpiration.class);
        Assertions.assertEquals(CookieExpirationConvention.FIXED_TIME, model.convention());
        Assertions.assertEquals("y", model.timeToExpiration());
    }
}
