@@ -51,7 +51,8 @@ public class TestOAuth2 : IAsyncLifetime
51
51
private readonly IConnectionFactory _connectionFactory ;
52
52
private readonly int _tokenExpiresInSeconds ;
53
53
private readonly OAuth2ClientCredentialsProvider _producerCredentialsProvider ;
54
- private readonly OAuth2ClientCredentialsProvider _httpApiCredentialsProvider ;
54
+ // TODO rabbitmq-dotnet-client-1639
55
+ // private readonly OAuth2ClientCredentialsProvider _httpApiCredentialsProvider;
55
56
private readonly CancellationTokenSource _cancellationTokenSource = new CancellationTokenSource ( ) ;
56
57
57
58
private IConnection ? _connection ;
@@ -67,8 +68,9 @@ public TestOAuth2(ITestOutputHelper testOutputHelper)
67
68
var producerOptions = new OAuth2ProducerOptions ( mode ) ;
68
69
_producerCredentialsProvider = GetCredentialsProvider ( producerOptions ) ;
69
70
70
- var httpApiOptions = new OAuth2HttpApiOptions ( mode ) ;
71
- _httpApiCredentialsProvider = GetCredentialsProvider ( httpApiOptions ) ;
71
+ // TODO rabbitmq-dotnet-client-1639
72
+ // var httpApiOptions = new OAuth2HttpApiOptions(mode);
73
+ // _httpApiCredentialsProvider = GetCredentialsProvider(httpApiOptions);
72
74
73
75
_connectionFactory = new ConnectionFactory
74
76
{
@@ -127,27 +129,24 @@ public async Task DisposeAsync()
127
129
private Task OnCredentialsRefreshedAsync ( Credentials ? credentials , Exception ? exception ,
128
130
CancellationToken cancellationToken = default )
129
131
{
130
- Console . WriteLine ( "{0} [INFO] OnCredentialsRefreshedAsync start" , DateTime . Now ) ;
131
-
132
132
if ( _connection is null )
133
133
{
134
+ _testOutputHelper . WriteLine ( "connection is unexpectedly null!" ) ;
134
135
Assert . Fail ( "_connection is unexpectedly null!" ) ;
135
136
}
136
137
137
138
if ( exception != null )
138
139
{
139
- Console . WriteLine ( "{0} [ERROR] OnCredentialsRefreshedAsync exception: {1}" ,
140
- DateTime . Now , exception ) ;
140
+ _testOutputHelper . WriteLine ( "exception is unexpectedly not-null: {0}" , exception ) ;
141
141
Assert . Fail ( $ "exception is unexpectedly not-null: { exception } ") ;
142
142
}
143
143
144
144
if ( credentials is null )
145
145
{
146
+ _testOutputHelper . WriteLine ( "credentials arg is unexpectedly null!" ) ;
146
147
Assert . Fail ( "credentials arg is unexpectedly null!" ) ;
147
148
}
148
149
149
- _testOutputHelper . WriteLine ( "{0} [INFO] calling UpdateSecretAsync" , DateTime . Now ) ;
150
- Console . WriteLine ( "{0} [INFO] calling UpdateSecretAsync" , DateTime . Now ) ;
151
150
return _connection . UpdateSecretAsync ( credentials . Password , "Token refresh" , cancellationToken ) ;
152
151
}
153
152
@@ -177,8 +176,10 @@ public async void IntegrationTest()
177
176
async Task CloseConnection ( )
178
177
{
179
178
Assert . NotNull ( _connection ) ;
180
- Credentials httpApiCredentials = await _httpApiCredentialsProvider . GetCredentialsAsync ( ) ;
181
- closeConnectionUtil = new Util ( "mgt_api_client" , httpApiCredentials . Password ) ;
179
+ // TODO rabbitmq-dotnet-client-1639
180
+ // Credentials httpApiCredentials = await _httpApiCredentialsProvider.GetCredentialsAsync();
181
+ // closeConnectionUtil = new Util("mgt_api_client", httpApiCredentials.Password);
182
+ closeConnectionUtil = new Util ( ) ;
182
183
await closeConnectionUtil . CloseConnectionAsync ( _connection . ClientProvidedName ) ;
183
184
}
184
185
0 commit comments