11// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
22// SPDX-License-Identifier: Apache-2.0
33
4- import aws.sdk.kotlin.runtime.auth.credentials.EnvironmentCredentialsProvider
54import aws.sdk.kotlin.services.secretsmanager.SecretsManagerClient
65import aws.sdk.kotlin.services.secretsmanager.model.GetSecretValueRequest
76import com.google.gson.Gson
@@ -18,11 +17,14 @@ import org.junit.jupiter.api.Order
1817import org.junit.jupiter.api.Test
1918import org.junit.jupiter.api.TestInstance
2019import org.junit.jupiter.api.TestMethodOrder
20+ import org.slf4j.Logger
21+ import org.slf4j.LoggerFactory
2122import java.util.UUID
2223
2324@TestInstance(TestInstance .Lifecycle .PER_CLASS )
2425@TestMethodOrder(OrderAnnotation ::class )
2526class GlueTest {
27+ private val logger: Logger = LoggerFactory .getLogger(GlueTest ::class .java)
2628 private var cron = " "
2729 private var iam = " "
2830 private var tableName = " "
@@ -53,55 +55,38 @@ class GlueTest {
5355 crawlerNameSc = values.crawlerNameSc.toString() + UUID .randomUUID()
5456 scriptLocationSc = values.scriptLocationSc.toString()
5557 locationUri = values.locationUri.toString()
56-
57- // Uncomment the block below if using config.properties file
58- /*
59- val input = this.javaClass.getClassLoader().getResourceAsStream("config.properties")
60- val prop = Properties()
61- prop.load(input)
62- cron = prop.getProperty("cron")
63- iam = prop.getProperty("IAM")
64- tableName = prop.getProperty("tableName")
65- text = prop.getProperty("text")
66- jobNameSc = prop.getProperty("jobNameSc")
67- s3PathSc = prop.getProperty("s3PathSc")
68- dbNameSc = prop.getProperty("dbNameSc")
69- crawlerNameSc = prop.getProperty("crawlerNameSc")
70- scriptLocationSc = prop.getProperty("scriptLocationSc")
71- locationUri = prop.getProperty("locationUri")
72- */
7358 }
7459
7560 @Test
7661 @Order(1 )
7762 fun getCrawlersTest () =
7863 runBlocking {
7964 getAllCrawlers()
80- println (" Test 2 passed" )
65+ logger.info (" Test 1 passed" )
8166 }
8267
8368 @Test
8469 @Order(2 )
8570 fun getDatabasesTest () =
8671 runBlocking {
8772 getAllDatabases()
88- println (" Test 4 passed" )
73+ logger.info (" Test 2 passed" )
8974 }
9075
9176 @Test
9277 @Order(3 )
9378 fun searchTablesTest () =
9479 runBlocking {
9580 searchGlueTable(text)
96- println (" Test 5 passed" )
81+ logger.info (" Test 3 passed" )
9782 }
9883
9984 @Test
10085 @Order(4 )
10186 fun listWorkflowsTest () =
10287 runBlocking {
10388 listAllWorkflows()
104- println (" Test 6 passed" )
89+ logger.info (" Test 4 passed" )
10590 }
10691
10792 private suspend fun getSecretValues (): String {
@@ -112,7 +97,6 @@ class GlueTest {
11297 }
11398 SecretsManagerClient {
11499 region = " us-east-1"
115- credentialsProvider = EnvironmentCredentialsProvider ()
116100 }.use { secretClient ->
117101 val valueResponse = secretClient.getSecretValue(valueRequest)
118102 return valueResponse.secretString.toString()
0 commit comments