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
@@ -20,10 +19,13 @@ import org.junit.jupiter.api.Order
2019import org.junit.jupiter.api.Test
2120import org.junit.jupiter.api.TestInstance
2221import org.junit.jupiter.api.TestMethodOrder
22+ import org.slf4j.Logger
23+ import org.slf4j.LoggerFactory
2324
2425@TestInstance(TestInstance .Lifecycle .PER_CLASS )
2526@TestMethodOrder(OrderAnnotation ::class )
2627class LexTest {
28+ private val logger: Logger = LoggerFactory .getLogger(LexTest ::class .java)
2729 private var botName = " "
2830 private var intentName = " "
2931 private var intentVersion = " "
@@ -38,61 +40,54 @@ class LexTest {
3840 botName = values.botName.toString()
3941 intentName = values.intentName.toString()
4042 intentVersion = values.intentVersion.toString()
41-
42- // val input = this.javaClass.getClassLoader().getResourceAsStream("config.properties")
43- // val prop = Properties()
44- // prop.load(input)
45- // botName = prop.getProperty("botName")
46- // intentName = prop.getProperty("intentName")
47- // intentVersion = prop.getProperty("intentVersion")
4843 }
4944
5045 @Test
5146 @Order(1 )
5247 fun putBotTest () =
5348 runBlocking {
5449 createBot(botName, intentName, intentVersion)
55- println (" Test 1 passed" )
50+ logger.info (" Test 1 passed" )
5651 }
5752
5853 @Test
5954 @Order(2 )
6055 fun getBotsTest () =
6156 runBlocking {
6257 getAllBots()
63- println (" Test 2 passed" )
58+ logger.info (" Test 2 passed" )
6459 }
6560
6661 @Test
6762 @Order(3 )
6863 fun getIntentTest () =
6964 runBlocking {
7065 getSpecificIntent(intentName, intentVersion)
71- println (" Test 3 passed" )
66+ logger.info (" Test 3 passed" )
7267 }
7368
7469 @Test
7570 @Order(4 )
7671 fun getSlotTypesTest () =
7772 runBlocking {
7873 getSlotsInfo()
79- println (" Test 4 passed" )
74+ logger.info (" Test 4 passed" )
8075 }
8176
8277 @Test
8378 @Order(5 )
8479 fun getBotStatusTest () =
8580 runBlocking {
8681 getStatus(botName)
87- println (" Test 5 passed" )
82+ logger.info (" Test 5 passed" )
8883 }
8984
9085 @Test
9186 @Order(6 )
9287 fun deleteBotTest () =
9388 runBlocking {
9489 deleteSpecificBot(botName)
95- println (" Test 6 passed" )
90+ logger.info (" Test 6 passed" )
9691 }
9792
9893 private suspend fun getSecretValues (): String {
@@ -103,7 +98,6 @@ class LexTest {
10398 }
10499 SecretsManagerClient {
105100 region = " us-east-1"
106- credentialsProvider = EnvironmentCredentialsProvider ()
107101 }.use { secretClient ->
108102 val valueResponse = secretClient.getSecretValue(valueRequest)
109103 return valueResponse.secretString.toString()
0 commit comments