@@ -334,10 +334,6 @@ def test_resume_migration_promotes_validate_only_succeeded(self):
334334 mock_get .return_value = {
335335 'status' : 'succeeded' ,
336336 'validateOnly' : True ,
337- 'targetRepository' : 'https://ghe.example.com/org/repo' ,
338- 'targetOwnerUserId' : 'testuser' ,
339- 'agentPoolName' : 'MyPool' ,
340- 'scheduledCutoverDate' : '2030-06-01T00:00:00Z' ,
341337 }
342338 mock_resolve .return_value = self ._TEST_ORG
343339
@@ -346,16 +342,12 @@ def test_resume_migration_promotes_validate_only_succeeded(self):
346342 organization = self ._TEST_ORG , detect = False )
347343
348344 args = mock_send .call_args [0 ]
349- self .assertEqual (args [1 ], 'POST ' )
345+ self .assertEqual (args [1 ], 'PUT ' )
350346 payload = args [3 ]
351347 self .assertFalse (payload ['validateOnly' ])
352- self .assertEqual (payload ['skipValidation' ], 2147483647 )
353- self .assertEqual (payload ['targetRepository' ], 'https://ghe.example.com/org/repo' )
354- self .assertEqual (payload ['targetOwnerUserId' ], 'testuser' )
355- self .assertEqual (payload ['agentPoolName' ], 'MyPool' )
356- self .assertEqual (payload ['scheduledCutoverDate' ], '2030-06-01T00:00:00Z' )
348+ self .assertEqual (payload ['statusRequested' ], 'active' )
357349
358- def test_resume_migration_promote_omits_null_optional_fields (self ):
350+ def test_resume_migration_promote_uses_only_state_transition_fields (self ):
359351 with patch ('azext_devops.dev.migration.migration.get_migration' ) as mock_get , \
360352 patch ('azext_devops.dev.migration.migration.resolve_instance' ) as mock_resolve , \
361353 patch ('azext_devops.dev.migration.migration._get_service_client' ) as mock_client , \
@@ -366,6 +358,9 @@ def test_resume_migration_promote_omits_null_optional_fields(self):
366358 'validateOnly' : True ,
367359 'targetRepository' : 'https://ghe.example.com/org/repo' ,
368360 'targetOwnerUserId' : 'testuser' ,
361+ 'agentPoolName' : 'MyPool' ,
362+ 'scheduledCutoverDate' : '2030-06-01T00:00:00Z' ,
363+ 'skipValidation' : 2147483647 ,
369364 }
370365 mock_resolve .return_value = self ._TEST_ORG
371366
@@ -374,8 +369,14 @@ def test_resume_migration_promote_omits_null_optional_fields(self):
374369 organization = self ._TEST_ORG , detect = False )
375370
376371 payload = mock_send .call_args [0 ][3 ]
372+ self .assertEqual (payload ['validateOnly' ], False )
373+ self .assertEqual (payload ['statusRequested' ], 'active' )
374+ self .assertEqual (set (payload .keys ()), {'validateOnly' , 'statusRequested' })
377375 self .assertNotIn ('agentPoolName' , payload )
378376 self .assertNotIn ('scheduledCutoverDate' , payload )
377+ self .assertNotIn ('targetRepository' , payload )
378+ self .assertNotIn ('targetOwnerUserId' , payload )
379+ self .assertNotIn ('skipValidation' , payload )
379380
380381 def test_resume_succeeded_without_migration_flag_errors (self ):
381382 with patch ('azext_devops.dev.migration.migration.get_migration' ) as mock_get , \
0 commit comments