-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #432 from atlanhq/DVX-119
Fix class used for enrichment migrator
- Loading branch information
Showing
2 changed files
with
49 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
samples/packages/enrichment-migrator/src/test/kotlin/EnrichmentMigratorTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/* SPDX-License-Identifier: Apache-2.0 | ||
Copyright 2023 Atlan Pte. Ltd. */ | ||
import com.atlan.model.assets.Connection | ||
import com.atlan.model.enums.AtlanConnectorType | ||
import com.atlan.pkg.PackageTest | ||
import org.testng.ITestContext | ||
import org.testng.annotations.AfterClass | ||
import org.testng.annotations.BeforeClass | ||
import kotlin.test.Test | ||
|
||
/** | ||
* Test migration of asset metadata. | ||
*/ | ||
class EnrichmentMigratorTest : PackageTest() { | ||
|
||
private val files = listOf( | ||
"asset-export.csv", | ||
"debug.log", | ||
) | ||
|
||
@BeforeClass | ||
fun beforeClass() { | ||
setup( | ||
EnrichmentMigratorCfg( | ||
sourceConnection = Connection.findByName("development", AtlanConnectorType.MSSQL)?.get(0)?.qualifiedName, | ||
targetConnection = Connection.findByName("development", AtlanConnectorType.SNOWFLAKE)?.get(0)?.qualifiedName, | ||
failOnErrors = false, | ||
), | ||
) | ||
EnrichmentMigrator.main(arrayOf(testDirectory)) | ||
} | ||
|
||
@Test | ||
fun filesCreated() { | ||
validateFilesExist(files) | ||
} | ||
|
||
@Test | ||
fun errorFreeLog() { | ||
validateErrorFreeLog() | ||
} | ||
|
||
@AfterClass(alwaysRun = true) | ||
fun afterClass(context: ITestContext) { | ||
teardown(context.failedTests.size() > 0) | ||
} | ||
} |