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

package com.azure.resourcemanager.synapse.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.synapse.models.WorkspaceRepositoryConfiguration;
import java.util.UUID;
import org.junit.jupiter.api.Assertions;

public final class WorkspaceRepositoryConfigurationTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        WorkspaceRepositoryConfiguration model =
            BinaryData
                .fromString(
                    "{\"type\":\"pqfrtqlkz\",\"hostName\":\"gnitgvkxlzyq\",\"accountName\":\"fegcea\",\"projectName\":\"xwh\",\"repositoryName\":\"nsymoyqhlwigd\",\"collaborationBranch\":\"bkbxgomfa\",\"rootFolder\":\"wasqvdaeyyg\",\"lastCommitId\":\"akjsqz\",\"tenantId\":\"3702a1d4-9dbe-4cc4-9101-bcd4a55fa392\"}")
                .toObject(WorkspaceRepositoryConfiguration.class);
        Assertions.assertEquals("pqfrtqlkz", model.type());
        Assertions.assertEquals("gnitgvkxlzyq", model.hostname());
        Assertions.assertEquals("fegcea", model.accountName());
        Assertions.assertEquals("xwh", model.projectName());
        Assertions.assertEquals("nsymoyqhlwigd", model.repositoryName());
        Assertions.assertEquals("bkbxgomfa", model.collaborationBranch());
        Assertions.assertEquals("wasqvdaeyyg", model.rootFolder());
        Assertions.assertEquals("akjsqz", model.lastCommitId());
        Assertions.assertEquals(UUID.fromString("3702a1d4-9dbe-4cc4-9101-bcd4a55fa392"), model.tenantId());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        WorkspaceRepositoryConfiguration model =
            new WorkspaceRepositoryConfiguration()
                .withType("pqfrtqlkz")
                .withHostname("gnitgvkxlzyq")
                .withAccountName("fegcea")
                .withProjectName("xwh")
                .withRepositoryName("nsymoyqhlwigd")
                .withCollaborationBranch("bkbxgomfa")
                .withRootFolder("wasqvdaeyyg")
                .withLastCommitId("akjsqz")
                .withTenantId(UUID.fromString("3702a1d4-9dbe-4cc4-9101-bcd4a55fa392"));
        model = BinaryData.fromObject(model).toObject(WorkspaceRepositoryConfiguration.class);
        Assertions.assertEquals("pqfrtqlkz", model.type());
        Assertions.assertEquals("gnitgvkxlzyq", model.hostname());
        Assertions.assertEquals("fegcea", model.accountName());
        Assertions.assertEquals("xwh", model.projectName());
        Assertions.assertEquals("nsymoyqhlwigd", model.repositoryName());
        Assertions.assertEquals("bkbxgomfa", model.collaborationBranch());
        Assertions.assertEquals("wasqvdaeyyg", model.rootFolder());
        Assertions.assertEquals("akjsqz", model.lastCommitId());
        Assertions.assertEquals(UUID.fromString("3702a1d4-9dbe-4cc4-9101-bcd4a55fa392"), model.tenantId());
    }
}
