@@ -31,7 +31,8 @@ import java.util.Random
3131class RedshiftKotlinTest {
3232 private var clusterId = " "
3333 private var eventSourceType = " "
34- private var secretName = " "
34+ private var username = " "
35+ private var password = " "
3536
3637 @BeforeAll
3738 fun setup () =
@@ -44,7 +45,8 @@ class RedshiftKotlinTest {
4445 val json: String = getSecretValues().toString()
4546 val values = gson.fromJson(json, SecretValues ::class .java)
4647 clusterId = values.clusterId + randomNum
47- secretName = values.secretName.toString()
48+ username = values.userName.toString()
49+ password = values.password.toString()
4850 eventSourceType = values.eventSourceType.toString()
4951
5052// Uncomment this code block if you prefer using a config.properties file to retrieve AWS values required for these tests.
@@ -62,67 +64,26 @@ class RedshiftKotlinTest {
6264 @Order(1 )
6365 fun createClusterTest () =
6466 runBlocking {
65- val gson = Gson ()
66- val user =
67- gson.fromJson(
68- com.kotlin.redshift
69- .getSecretValues(secretName)
70- .toString(),
71- User ::class .java,
72- )
73- val username = user.username
74- val userPassword = user.password
75- createCluster(clusterId, username, userPassword)
67+ createCluster(clusterId, username, password)
7668 println (" Test 2 passed" )
7769 }
7870
7971 @Test
8072 @Order(2 )
81- fun waitForClusterReadyTest () =
82- runBlocking {
83- waitForClusterReady(clusterId)
84- println (" Test 3 passed" )
85- }
86-
87- @Test
88- @Order(3 )
89- fun modifyClusterReadyTest () =
90- runBlocking {
91- modifyCluster(clusterId)
92- println (" Test 4 passed" )
93- }
94-
95- @Test
96- @Order(4 )
9773 fun describeClustersTest () =
9874 runBlocking {
9975 describeRedshiftClusters()
10076 println (" Test 5 passed" )
10177 }
10278
10379 @Test
104- @Order(5 )
80+ @Order(3 )
10581 fun findReservedNodeOfferTest () =
10682 runBlocking {
10783 findReservedNodeOffer()
10884 println (" Test 6 passed" )
10985 }
11086
111- @Test
112- @Order(6 )
113- fun listEventsTest () =
114- runBlocking {
115- listRedShiftEvents(clusterId, eventSourceType)
116- println (" Test 7 passed" )
117- }
118-
119- @Test
120- @Order(7 )
121- fun deleteClusterTest () =
122- runBlocking {
123- deleteRedshiftCluster(clusterId)
124- println (" Test 8 passed" )
125- }
12687
12788 suspend fun getSecretValues (): String? {
12889 val secretName = " test/red"
@@ -142,6 +103,7 @@ class RedshiftKotlinTest {
142103 internal inner class SecretValues {
143104 val clusterId: String? = null
144105 val eventSourceType: String? = null
145- val secretName: String? = null
106+ val userName: String? = null
107+ val password: String? = null
146108 }
147109}
0 commit comments