@@ -151,30 +151,30 @@ async fn test_migration_step_3() -> Result<(), Box<dyn std::error::Error>> {
151
151
let partition_key = Uuid :: new_v4 ( ) . to_string ( ) ;
152
152
let sort_keys = [ "0" , "1" , "2" , "3" ] ;
153
153
154
+ // Successfully executes step 3
155
+ let success = migration_step_3_example ( kms_key_id, table_name, & partition_key, sort_keys[ 3 ] , sort_keys[ 3 ] ) . await ?;
156
+ assert ! ( success, "MigrationStep3 should complete successfully" ) ;
157
+
154
158
// Given: Step 0 has succeeded
155
159
let success = migration_step_0_example ( table_name, & partition_key, sort_keys[ 0 ] , sort_keys[ 0 ] ) . await ?;
156
160
assert ! ( success, "MigrationStep0 should complete successfully" ) ;
157
161
158
- // Given: Step 1 has succeeded
159
- let success = migration_step_1_example ( kms_key_id, table_name, & partition_key, sort_keys[ 1 ] , sort_keys[ 1 ] ) . await ?;
160
- assert ! ( success, "MigrationStep1 should complete successfully" ) ;
161
-
162
- // Given: Step 2 has succeeded
163
- let success = migration_step_2_example ( kms_key_id, table_name, & partition_key, sort_keys[ 2 ] , sort_keys[ 2 ] ) . await ?;
164
- assert ! ( success, "MigrationStep2 should complete successfully" ) ;
165
-
166
- // Successfully executes step 3
167
- let success = migration_step_3_example ( kms_key_id, table_name, & partition_key, sort_keys[ 3 ] , sort_keys[ 3 ] ) . await ?;
168
- assert ! ( success, "MigrationStep3 should complete successfully" ) ;
169
-
170
162
// When: Execute Step 3 with sortReadValue=0, Then: should error out when reading plaintext items from Step 0
171
163
let result = migration_step_3_example ( kms_key_id, table_name, & partition_key, sort_keys[ 3 ] , sort_keys[ 0 ] ) . await ;
172
164
assert ! ( result. is_err( ) , "MigrationStep3 should fail when reading plaintext items" ) ;
173
165
166
+ // Given: Step 1 has succeeded
167
+ let success = migration_step_1_example ( kms_key_id, table_name, & partition_key, sort_keys[ 1 ] , sort_keys[ 1 ] ) . await ?;
168
+ assert ! ( success, "MigrationStep1 should complete successfully" ) ;
169
+
174
170
// When: Execute Step 3 with sortReadValue=1, Then: should error out when reading plaintext items from Step 1
175
171
let result = migration_step_3_example ( kms_key_id, table_name, & partition_key, sort_keys[ 3 ] , sort_keys[ 1 ] ) . await ;
176
172
assert ! ( result. is_err( ) , "MigrationStep3 should fail when reading plaintext items" ) ;
177
173
174
+ // Given: Step 2 has succeeded
175
+ let success = migration_step_2_example ( kms_key_id, table_name, & partition_key, sort_keys[ 2 ] , sort_keys[ 2 ] ) . await ?;
176
+ assert ! ( success, "MigrationStep2 should complete successfully" ) ;
177
+
178
178
// When: Execute Step 3 with sortReadValue=2, Then: Success (i.e. can read encrypted values from Step 2)
179
179
let success = migration_step_3_example ( kms_key_id, table_name, & partition_key, sort_keys[ 3 ] , sort_keys[ 2 ] ) . await ?;
180
180
assert ! ( success, "MigrationStep3 should be able to read items written by Step 2" ) ;
0 commit comments