@@ -51,8 +51,7 @@ public class TestOAuth2 : IAsyncLifetime
5151 private readonly IConnectionFactory _connectionFactory ;
5252 private readonly int _tokenExpiresInSeconds ;
5353 private readonly OAuth2ClientCredentialsProvider _producerCredentialsProvider ;
54- // TODO rabbitmq-dotnet-client-1639
55- // private readonly OAuth2ClientCredentialsProvider _httpApiCredentialsProvider;
54+ private readonly OAuth2ClientCredentialsProvider _httpApiCredentialsProvider ;
5655 private readonly CancellationTokenSource _cancellationTokenSource = new CancellationTokenSource ( ) ;
5756
5857 private IConnection ? _connection ;
@@ -68,9 +67,8 @@ public TestOAuth2(ITestOutputHelper testOutputHelper)
6867 var producerOptions = new OAuth2ProducerOptions ( mode ) ;
6968 _producerCredentialsProvider = GetCredentialsProvider ( producerOptions ) ;
7069
71- // TODO rabbitmq-dotnet-client-1639
72- // var httpApiOptions = new OAuth2HttpApiOptions(mode);
73- // _httpApiCredentialsProvider = GetCredentialsProvider(httpApiOptions);
70+ var httpApiOptions = new OAuth2HttpApiOptions ( mode ) ;
71+ _httpApiCredentialsProvider = GetCredentialsProvider ( httpApiOptions ) ;
7472
7573 _connectionFactory = new ConnectionFactory
7674 {
@@ -176,10 +174,8 @@ public async void IntegrationTest()
176174 async Task CloseConnection ( )
177175 {
178176 Assert . NotNull ( _connection ) ;
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 ( _testOutputHelper ) ;
177+ Credentials httpApiCredentials = await _httpApiCredentialsProvider . GetCredentialsAsync ( ) ;
178+ closeConnectionUtil = new Util ( _testOutputHelper , "mgt_api_client" , httpApiCredentials . Password ) ;
183179 await closeConnectionUtil . CloseConnectionAsync ( _connection . ClientProvidedName ) ;
184180 }
185181
@@ -192,12 +188,12 @@ async Task CloseConnection()
192188 {
193189 await closeConnectionTask ;
194190 closeConnectionTask = null ;
195- }
196191
197- if ( closeConnectionUtil != null )
198- {
199- closeConnectionUtil . Dispose ( ) ;
200- closeConnectionUtil = null ;
192+ if ( closeConnectionUtil != null )
193+ {
194+ closeConnectionUtil . Dispose ( ) ;
195+ closeConnectionUtil = null ;
196+ }
201197 }
202198
203199 _testOutputHelper . WriteLine ( "{0} [INFO] Resuming ..." , DateTime . Now ) ;
0 commit comments