File tree Expand file tree Collapse file tree 3 files changed +4
-11
lines changed
Atlassian.Bitbucket.Tests Expand file tree Collapse file tree 3 files changed +4
-11
lines changed Original file line number Diff line number Diff line change @@ -25,9 +25,8 @@ public async Task BitbucketAuthentication_GetBasicCredentialsAsync_SucceedsAfter
25
25
Assert . Equal ( password , result . Password ) ;
26
26
}
27
27
28
- [ Theory ]
29
- [ InlineData ( "jsquire" , "password" ) ]
30
- public async Task BitbucketAuthentication_ShowOAuthRequiredPromptAsync_SucceedsAfterUserInput ( string username , string password )
28
+ [ Fact ]
29
+ public async Task BitbucketAuthentication_ShowOAuthRequiredPromptAsync_SucceedsAfterUserInput ( )
31
30
{
32
31
var context = new TestCommandContext ( ) ;
33
32
context . Terminal . Prompts [ "Press enter to continue..." ] = " " ;
Original file line number Diff line number Diff line change @@ -56,15 +56,15 @@ public void BitbucketHostProvider_IsSupported_FailsForNullInput()
56
56
{
57
57
InputArguments input = null ;
58
58
var provider = new BitbucketHostProvider ( new TestCommandContext ( ) ) ;
59
- Assert . Equal ( false , provider . IsSupported ( input ) ) ;
59
+ Assert . False ( provider . IsSupported ( input ) ) ;
60
60
}
61
61
62
62
[ Fact ]
63
63
public void BitbucketHostProvider_IsSupported_FailsForNullHttpResponseMessage ( )
64
64
{
65
65
HttpResponseMessage httpResponseMessage = null ;
66
66
var provider = new BitbucketHostProvider ( new TestCommandContext ( ) ) ;
67
- Assert . Equal ( false , provider . IsSupported ( httpResponseMessage ) ) ;
67
+ Assert . False ( provider . IsSupported ( httpResponseMessage ) ) ;
68
68
}
69
69
70
70
[ Theory ]
Original file line number Diff line number Diff line change @@ -144,9 +144,6 @@ private async Task<ICredential> GetRefreshedCredentials(InputArguments input)
144
144
// There is no refresh token either because this is a non-2FA enabled account (where OAuth is not
145
145
// required), or because we previously erased the RT.
146
146
147
- // Check for the presence of a credential in the store
148
- string credentialService = GetServiceName ( input ) ;
149
-
150
147
if ( SupportsBasicAuth ( authModes ) )
151
148
{
152
149
_context . Trace . WriteLine ( "Prompt for Basic Auth..." ) ;
@@ -181,9 +178,6 @@ private async Task<ICredential> GetRefreshedCredentials(InputArguments input)
181
178
{
182
179
_context . Trace . WriteLineSecrets ( $ "Found stored refresh token: {{0}}", new object [ ] { refreshToken } ) ;
183
180
184
- // It's very likely that any access token expired between the last time we used/stored it.
185
- // To ensure the AT is as 'fresh' as it can be, always first try to use the refresh token
186
- // (which lives longer) to create a new AT (and possibly also a new RT).
187
181
try
188
182
{
189
183
return await GetOAuthCredentialsViaRefreshFlow ( input , refreshToken ) ;
You can’t perform that action at this time.
0 commit comments