@@ -219,7 +219,7 @@ public void BitbucketHostProvider_GetCredentialAsync_Succeeds_ForFreshValidBasic
219219
220220 var credential = provider . GetCredentialAsync ( input ) ;
221221
222- VerifyBasicAuthFlowRan ( password , true , input , credential , null ) ;
222+ VerifyBasicAuthFlowRan ( password , true , input , credential ) ;
223223
224224 VerifyOAuthFlowDidNotRun ( password , true , input , credential ) ;
225225 }
@@ -327,7 +327,7 @@ public void BitbucketHostProvider_GetCredentialAsync_AlwaysRefreshCredentials_Is
327327
328328 if ( alwaysRefreshCredentialsBool )
329329 {
330- VerifyBasicAuthFlowRan ( password , true , input , credential , null ) ;
330+ VerifyBasicAuthFlowRan ( password , true , input , credential ) ;
331331 }
332332 else
333333 {
@@ -450,21 +450,13 @@ private static InputArguments MockInput(string protocol, string host, string use
450450 } ) ;
451451 }
452452
453- private void VerifyBasicAuthFlowRan ( string password , bool expected , InputArguments input , Task < ICredential > credential ,
454- string preconfiguredAuthModes )
453+ private void VerifyBasicAuthFlowRan ( string password , bool expected , InputArguments input , Task < ICredential > credential )
455454 {
456455 Assert . Equal ( expected , credential != null ) ;
457456
458457 var remoteUri = input . GetRemoteUri ( ) ;
459458
460459 bitbucketAuthentication . Verify ( m => m . GetCredentialsAsync ( remoteUri , input . UserName , It . IsAny < AuthenticationModes > ( ) ) , Times . Once ) ;
461-
462- // check username/password for Bitbucket.org
463- if ( ( preconfiguredAuthModes == null && BITBUCKET_DOT_ORG_HOST == remoteUri . Host )
464- || ( preconfiguredAuthModes != null && preconfiguredAuthModes . Contains ( "oauth" ) ) )
465- {
466- bitbucketApi . Verify ( m => m . GetUserInformationAsync ( input . UserName , password , false ) , Times . Once ) ;
467- }
468460 }
469461
470462 private void VerifyInteractiveBasicAuthFlowRan ( string password , InputArguments input , Task < ICredential > credential )
@@ -473,12 +465,6 @@ private void VerifyInteractiveBasicAuthFlowRan(string password, InputArguments i
473465
474466 // verify users was prompted for username/password credentials
475467 bitbucketAuthentication . Verify ( m => m . GetCredentialsAsync ( remoteUri , input . UserName , It . IsAny < AuthenticationModes > ( ) ) , Times . Once ) ;
476-
477- // check username/password for Bitbucket.org
478- if ( BITBUCKET_DOT_ORG_HOST == remoteUri . Host )
479- {
480- bitbucketApi . Verify ( m => m . GetUserInformationAsync ( input . UserName , password , false ) , Times . Once ) ;
481- }
482468 }
483469
484470 private void VerifyBasicAuthFlowNeverRan ( string password , InputArguments input , bool storedAccount ,
@@ -527,13 +513,7 @@ private void VerifyOAuthFlowRan(string password, bool storedAccount, bool expect
527513 {
528514 // prompt user for basic auth, if basic auth is not excluded
529515 bitbucketAuthentication . Verify ( m => m . GetCredentialsAsync ( remoteUri , input . UserName , It . IsAny < AuthenticationModes > ( ) ) , Times . Once ) ;
530-
531- // check if entered Basic Auth credentials work, if basic auth is not excluded
532- bitbucketApi . Verify ( m => m . GetUserInformationAsync ( input . UserName , password , false ) , Times . Once ) ;
533516 }
534-
535- // Basic Auth 403-ed so push user through OAuth flow
536- bitbucketAuthentication . Verify ( m => m . ShowOAuthRequiredPromptAsync ( ) , Times . Once ) ;
537517 }
538518 }
539519
0 commit comments