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

package com.azure.resourcemanager.dataprotection.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.dataprotection.models.Datasource;
import org.junit.jupiter.api.Assertions;

public final class DatasourceTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        Datasource model =
            BinaryData
                .fromString(
                    "{\"datasourceType\":\"exim\",\"objectType\":\"yocf\",\"resourceID\":\"fksymddystki\",\"resourceLocation\":\"xhqyudxorrqnb\",\"resourceName\":\"czvyifq\",\"resourceType\":\"kdvjsll\",\"resourceUri\":\"vvdfwatkpnpul\"}")
                .toObject(Datasource.class);
        Assertions.assertEquals("exim", model.datasourceType());
        Assertions.assertEquals("yocf", model.objectType());
        Assertions.assertEquals("fksymddystki", model.resourceId());
        Assertions.assertEquals("xhqyudxorrqnb", model.resourceLocation());
        Assertions.assertEquals("czvyifq", model.resourceName());
        Assertions.assertEquals("kdvjsll", model.resourceType());
        Assertions.assertEquals("vvdfwatkpnpul", model.resourceUri());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        Datasource model =
            new Datasource()
                .withDatasourceType("exim")
                .withObjectType("yocf")
                .withResourceId("fksymddystki")
                .withResourceLocation("xhqyudxorrqnb")
                .withResourceName("czvyifq")
                .withResourceType("kdvjsll")
                .withResourceUri("vvdfwatkpnpul");
        model = BinaryData.fromObject(model).toObject(Datasource.class);
        Assertions.assertEquals("exim", model.datasourceType());
        Assertions.assertEquals("yocf", model.objectType());
        Assertions.assertEquals("fksymddystki", model.resourceId());
        Assertions.assertEquals("xhqyudxorrqnb", model.resourceLocation());
        Assertions.assertEquals("czvyifq", model.resourceName());
        Assertions.assertEquals("kdvjsll", model.resourceType());
        Assertions.assertEquals("vvdfwatkpnpul", model.resourceUri());
    }
}
