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

package com.azure.resourcemanager.deploymentmanager.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.deploymentmanager.models.ApiKeyAuthentication;
import com.azure.resourcemanager.deploymentmanager.models.RestAuthLocation;
import org.junit.jupiter.api.Assertions;

public final class ApiKeyAuthenticationTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        ApiKeyAuthentication model =
            BinaryData
                .fromString("{\"type\":\"ApiKey\",\"name\":\"ok\",\"in\":\"Query\",\"value\":\"ljyoxgvcltb\"}")
                .toObject(ApiKeyAuthentication.class);
        Assertions.assertEquals("ok", model.name());
        Assertions.assertEquals(RestAuthLocation.QUERY, model.in());
        Assertions.assertEquals("ljyoxgvcltb", model.value());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        ApiKeyAuthentication model =
            new ApiKeyAuthentication().withName("ok").withIn(RestAuthLocation.QUERY).withValue("ljyoxgvcltb");
        model = BinaryData.fromObject(model).toObject(ApiKeyAuthentication.class);
        Assertions.assertEquals("ok", model.name());
        Assertions.assertEquals(RestAuthLocation.QUERY, model.in());
        Assertions.assertEquals("ljyoxgvcltb", model.value());
    }
}
