@@ -12,20 +12,35 @@ func TestMigrationStep1(t *testing.T) {
1212 kmsKeyID := utils .KmsKeyID ()
1313 tableName := utils .DdbTableName ()
1414 partitionKey := uuid .New ().String ()
15- sortKeys := []string {"0" , "1" , "2" }
15+ sortKeys := []string {"0" , "1" , "2" , "3" }
1616
1717 // Successfully executes Step 1
18- MigrationStep1 (kmsKeyID , tableName , partitionKey , sortKeys [1 ])
18+ err := MigrationStep1 (kmsKeyID , tableName , partitionKey , sortKeys [1 ])
19+ utils .HandleError (err )
1920
2021 // 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+
2225 // 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 )
2428
2529 // 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+
2733 // 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 )
2944
3045 // Cleanup
3146 for _ , sortKey := range sortKeys {
0 commit comments