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

package com.azure.resourcemanager.servicefabric.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.servicefabric.models.ServiceCorrelationDescription;
import com.azure.resourcemanager.servicefabric.models.ServiceCorrelationScheme;
import org.junit.jupiter.api.Assertions;

public final class ServiceCorrelationDescriptionTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        ServiceCorrelationDescription model =
            BinaryData
                .fromString("{\"scheme\":\"Affinity\",\"serviceName\":\"yftaakcpw\"}")
                .toObject(ServiceCorrelationDescription.class);
        Assertions.assertEquals(ServiceCorrelationScheme.AFFINITY, model.scheme());
        Assertions.assertEquals("yftaakcpw", model.serviceName());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        ServiceCorrelationDescription model =
            new ServiceCorrelationDescription()
                .withScheme(ServiceCorrelationScheme.AFFINITY)
                .withServiceName("yftaakcpw");
        model = BinaryData.fromObject(model).toObject(ServiceCorrelationDescription.class);
        Assertions.assertEquals(ServiceCorrelationScheme.AFFINITY, model.scheme());
        Assertions.assertEquals("yftaakcpw", model.serviceName());
    }
}
