@@ -12,20 +12,35 @@ func TestMigrationStep1(t *testing.T) {
12
12
kmsKeyID := utils .KmsKeyID ()
13
13
tableName := utils .DdbTableName ()
14
14
partitionKey := uuid .New ().String ()
15
- sortKeys := []string {"0" , "1" , "2" }
15
+ sortKeys := []string {"0" , "1" , "2" , "3" }
16
16
17
17
// Successfully executes Step 1
18
- MigrationStep1 (kmsKeyID , tableName , partitionKey , sortKeys [1 ])
18
+ err := MigrationStep1 (kmsKeyID , tableName , partitionKey , sortKeys [1 ])
19
+ utils .HandleError (err )
19
20
20
21
// Given: Step 0 has succeeded
21
- plaintext .MigrationStep0 (tableName , partitionKey , sortKeys [0 ])
22
+ err = plaintext .MigrationStep0 (tableName , partitionKey , sortKeys [0 ])
23
+ utils .HandleError (err )
24
+
22
25
// When: Execute Step 1 with sortReadValue=0, Then: Success (i.e. can read plaintext values)
23
- MigrationStep1 (kmsKeyID , tableName , partitionKey , sortKeys [0 ])
26
+ err = MigrationStep1 (kmsKeyID , tableName , partitionKey , sortKeys [0 ])
27
+ utils .HandleError (err )
24
28
25
29
// Given: Step 2 has succeeded
26
- MigrationStep2 (kmsKeyID , tableName , partitionKey , sortKeys [2 ])
30
+ err = MigrationStep2 (kmsKeyID , tableName , partitionKey , sortKeys [2 ])
31
+ utils .HandleError (err )
32
+
27
33
// When: Execute Step 1 with sortReadValue=2, Then: Success (i.e. can read encrypted values)
28
- MigrationStep1 (kmsKeyID , tableName , partitionKey , sortKeys [2 ])
34
+ err = MigrationStep1 (kmsKeyID , tableName , partitionKey , sortKeys [2 ])
35
+ utils .HandleError (err )
36
+
37
+ // Given: Step 3 has succeeded
38
+ err = MigrationStep3 (kmsKeyID , tableName , partitionKey , sortKeys [3 ])
39
+ utils .HandleError (err )
40
+
41
+ // When: Execute Step 1 with sortReadValue=3, Then: Success (i.e. can read encrypted values)
42
+ err = MigrationStep1 (kmsKeyID , tableName , partitionKey , sortKeys [3 ])
43
+ utils .HandleError (err )
29
44
30
45
// Cleanup
31
46
for _ , sortKey := range sortKeys {
0 commit comments